Skip to content

Commit

Permalink
Add script to update missing schema
Browse files Browse the repository at this point in the history
Adds a script to rewrite part of the bundled API spec, to work around
Redocly not having support for `patternProperties` (see also bug
Redocly/redocly-cli#792)
  • Loading branch information
samdbmg committed Dec 20, 2023
1 parent 9d357d0 commit 68f7980
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/Dockerfile.multi
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,13 @@ COPY ./TimeAddressableMediaStore.yaml .
###############################################################################
FROM redocly/cli as bundle

COPY ./bundle-api.sh /bundle-api.sh

# Copy in documentation source files
COPY --from=layer /api /data

ENTRYPOINT [ "/bundle-api.sh" ]

###############################################################################
# Stage: oaslint - Validates OpenAPI specifications
###############################################################################
Expand Down
7 changes: 7 additions & 0 deletions api/bundle-api.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh
set -euo pipefail

# Custom script to run the Redocly CLI bundler, then work around https://github.com/Redocly/redocly-cli/issues/792
# Passes all CLI args to the Redocly CLI, then calls `sed` to make manual edits as needed
redocly $@ | \
sed -e s_http-request.json_\'#/components/schemas/http-request\'_g

0 comments on commit 68f7980

Please sign in to comment.