Swagger not detecting Api built with Spring Data Rest

后端 未结 5 1944
我在风中等你
我在风中等你 2021-01-19 18:10

I\'m working on a spring boot application using swagger to generate docs for my API ,I\'m using Spring data rest to generate the Api but when I run the app I get the swagger

5条回答
  •  青春惊慌失措
    2021-01-19 18:37

    Based on the discussions on this springfox Github issue looks like you need to amend your config class to include an additional annotation, i.e.:

    @Configuration
    @EnableSwagger2
    @Import({springfox.documentation.spring.data.rest.configuration.SpringDataRestConfiguration.class})
    

    I can't test it as I only use swagger for Rest controllers at present but hope this helps.

提交回复
热议问题