0

So right now the default is: /v2/api-doc .

How can I configure swagger to be /v2/swagger.json

I don't know how to find the property file.

Solution is on the comments in .yml file :

springfox:
  documentation:
    swagger:
      v2:
       path: /v1/swagger.json
Ed Diaz
  • 97
  • 1
  • 11
  • Possible duplicate of [Why is v2/api-docs the default URL when using springfox and Swagger2?](https://stackoverflow.com/questions/39401010/why-is-v2-api-docs-the-default-url-when-using-springfox-and-swagger2) – Helen Jul 05 '18 at 14:18

2 Answers2

2

If you are using Springfox :

You can point users that want to generate code based on your swagger spec to /v2/api-docs. When you don't like what you're seeing, don't worry, this can be changed too. Add the property springfox.documentation.swagger.v2.path to the application.properties file of your application and set its value to any path you'd like the docs to be available on.

0

/v2/api-doc is default url.

To add your custom url add following in propertyfile

springfox.documentation.swagger.v2.path=/my/path
MyTwoCents
  • 7,284
  • 3
  • 24
  • 52