Swagger-ui: Multiple files to SWAGGER_JSON

Created on 17 Aug 2018  路  4Comments  路  Source: swagger-api/swagger-ui

I would like to know if there's a way to input multiple files to the environment variable SWAGGER_JSON variable in Docker that will generate something like a drop list in the UI or something.

For now I have something similar to this on my Dockerfile:

ENV SWAGGER_JSON "/docs/doc1.yaml"

And would like to know if there's a structure that maybe looks like:

ENV SWAGGER_JSON "['/docs/doc1.yaml','/docs/doc2.yaml']"
configuration docker enhancement

Most helpful comment

Once #4965 is merged, you can do this with the following..

Given a directory foo with one.yaml and two.yaml inside of it:

docker run -e 
\ URLS="[ { name: \"one\", url: \"/foo/one.yaml\"}, { name: \"two\", url: \"/foo/two.yaml\" } ]"
\ -v /Users/kyle/Code/ui/bar:/usr/share/nginx/html/foo -p 8080:8080 swagger-api/swagger-ui

All 4 comments

This isn't currently possible, but we can add it 馃槃

Once #4965 is merged, you can do this with the following..

Given a directory foo with one.yaml and two.yaml inside of it:

docker run -e 
\ URLS="[ { name: \"one\", url: \"/foo/one.yaml\"}, { name: \"two\", url: \"/foo/two.yaml\" } ]"
\ -v /Users/kyle/Code/ui/bar:/usr/share/nginx/html/foo -p 8080:8080 swagger-api/swagger-ui

How can the same environment variable be set in the docker compose. when I tried it is giving services.swaggerapp.environment contains an invalid type, it should be an object, or an array

@manjunathrvce this issue is resolved, please open a new one!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DavidBiesack picture DavidBiesack  路  4Comments

liuya05 picture liuya05  路  3Comments

nulltoken picture nulltoken  路  3Comments

fehguy picture fehguy  路  3Comments

songtianyi picture songtianyi  路  3Comments