Springfox swagger - no api-docs with spring boot jersey and gradle

后端 未结 3 671
-上瘾入骨i
-上瘾入骨i 2021-01-18 20:15

I have a spring boot application with jersey and gradle, and I am trying to automatically generate the API documentation using springfox.

I have followed the steps h

3条回答
  •  感情败类
    2021-01-18 20:31

    To be able to see Jersey methods from Springfox swagger UI:

    1. Configure your Swagger with Jersey following https://github.com/swagger-api/swagger-core/wiki/Swagger-Core-Jersey-2.X-Project-Setup-1.5
    2. Configure Springfox Swagger following http://springfox.github.io/springfox/docs/current/
    3. Add in you SpringBoot application configuration class (annotated with @Configuration):

      @Value("${springfox.documentation.swagger.v2.path}") private String swagger2Endpoint;

    4. In application.properties add reference to your Jersey swagger.json:

      springfox.documentation.swagger.v2.path=/{change it to your Jersey api path}/swagger.json

    Now you should be able to see Jersey Swagger generated api from Springfox Swagger UI page.

提交回复
热议问题