2
votes

In a springboot app context, i'm looking for the .json output of swagger.

Seems that in the docs, the /v2/api-docs is available, but there's nothing within this url in my project.

The UI swagger is available under /swagger-ui.html, where can I find the json output ?

3

3 Answers

3
votes

There is no physical json file/resource. It is generated at run-time and served up from memory.

Secondly the swagger-ui.html and all the javascript/css/images resources are served up from the springfox-swagger-ui library which is packaged up as a web-jars.

0
votes

Try this one. You will have to provide the group name.

http://<host>:<port>/v2/api-docs?group=<group-name>
0
votes

You don't have json endpoint out of the box. As I know, you have to build Docket for for every endpoint. Here is an example:

                Docket endpointDocket = new Docket(DocumentationType.SWAGGER_2)
                        .groupName("yourGroupName")
                        .select()
                        .paths(regex("yourEndpointUrl"))
                        .build();

You have to register it in app context. Then you will have url (as mentioned by mephis-slayer):

http://<host>:<port>/v2/api-docs?group=yourGroupName