简体   繁体   中英

Reference an external URL for swagger-UI

I'm working on a project with Spring boot and we already have a swagger documentation for it as a json file. We just included Swagger-ui and it's rendered under /projectName/swagger-ui.html.

We would like to make use of the external URL that references our Swagger json which is /projectName/docs/swagger.

How can we achieve such behavior on Swagger-UI to make use of our own URL and not the /v2/docs default.

Thank you

Inside projectName/docs/swagger there must be a index.yaml if i am not wrong. Add host for external call there.

host: '(your ip address):(port number)' 

like

host: '127.0.0.1:8080'

Then enable your API CORS for this request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM