How to generate swagger.json

Bikesh M picture Bikesh M · Jan 23, 2017 · Viewed 80.3k times · Source

I am using java spring boot framework to create REST api for my project and I am using "springfox-swagger2 and springfox-swagger-ui" for generating swagger documentation. I am able to see my documentation using the URL http://localhost:8080/swagger-ui.html.

How can I create or generate swagger.json / spec.json, The documentation should not be with this application, we are using a separate application for listing the API docs.

Answer

Liping Huang picture Liping Huang · Jan 24, 2017

You can get the url with your swagger-ui html page:

enter image description here

GET http://localhost:8080/v2/api-docs?group=App

And actually you can get all the urls with chrome/firefox develop tools network feature.