How to stop exploring json code in browser
Hi , I am trying to run swagger docker container with custom json file with help of https://swagger.io/docs/open-source-tools/swagger-ui/usage/installation/ by docker run -p 80:8080 -e SWAGGER_JSON=/foo/swagger.json -v /bar:/foo swaggerapi/swagger-ui
Here container works and site gets up .but my json file appears in swagger site like
when i click custom.json it's displaying my json code .
So how to stop display json code ? Can you help
How to hide custom.json file here
@Dhina-test to hide the custom.json file you need to update the docker command:- docker run -p 80:8080 -e SWAGGER_JSON=/foo/swagger.json -e CONFIG_URL=/foo/config.json -v /bar:/foo swaggerapi/swagger-ui and also update ypur config.json file ;- { "displayOperationId": false, "displayRequestDuration": false, "docExpansion": "none", "defaultModelExpandDepth": 0, "defaultModelsExpandDepth": 0 }
Hi @Aditay2002
I placed my custom.json and config.json file under bar folder
In config.json file i placed the code which you provided
And then here is my docker run command for swagger api
docker run -p 80:8080 -e SWAGGER_JSON=/foo/custom.json -e CONFIG_URL=/foo/config.json -v /home/dhina/swagger/bar:/foo swaggerapi/swagger-ui
and now swagger site is below
Can you help