Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

[cetic/swaggerui] Support for OpenAPI specification in YAML format #18

Open
docktermj opened this issue Nov 10, 2021 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@docktermj
Copy link

I see in the Configuration documentation that you have support for swaggerui.jsonUrl. Which seems to only support OpenAPI Specification in JSON format based on what I'm seeing at

{{- if .Values.deployment.jsonNoCheckCertificate }}
args : {{ (printf "[\"mkdir /api-doc && wget --no-check-certificate %s -O /api-doc/openapi.json && apk update && apk add jq && jq '.servers += [{\\\"url\\\":\\\"%s\\\",\\\"description\\\":\\\"%s\\\"}]' /api-doc/openapi.json > json.tmp && mv json.tmp /api-doc/openapi.json && /usr/share/nginx/run.sh\"]" .Values.swaggerui.jsonUrl .Values.swaggerui.server.url .Values.swaggerui.server.description ) }}
{{- else }}
args : {{ (printf "[\"mkdir /api-doc && wget %s -O /api-doc/openapi.json && apk update && apk add jq && jq '.servers += [{\\\"url\\\":\\\"%s\\\",\\\"description\\\":\\\"%s\\\"}]' /api-doc/openapi.json > json.tmp && mv json.tmp /api-doc/openapi.json && /usr/share/nginx/run.sh\"]" .Values.swaggerui.jsonUrl .Values.swaggerui.server.url .Values.swaggerui.server.description ) }}
{{- end }}

I know that the swaggerapi/swagger-ui Docker container can accept a YAML OpenAPI Specification file as identified by the URL environment variable. Example:

docker run \
  --env URL=https://raw.githubusercontent.com/Senzing/senzing-rest-api-specification/master/senzing-rest-api.yaml \
  --name senzing-swagger-ui \
  --publish 9180:8080 \
  --rm \
  swaggerapi/swagger-ui

Can you support YAML files, too? Or at least provide a way to disable setting args: so that I can pass in the URL environment variable via .Values.deployment.extraEnv?

You may want to consider only using the URL environment variable. The technique currently used mutates the container. Most folks want immutable containers. Just a thought.

Thank you!

By the way, nice work!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants