Swagger not detecting Api built with Spring Data Rest

后端 未结 5 1890
我在风中等你
我在风中等你 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:40

    pom.xml

    
        org.springframework.boot
        spring-boot-starter-parent
        2.2.2.RELEASE
        
    
    
    
        UTF-8
        UTF-8
        1.8
        3.0.0-SNAPSHOT
    
    
    
    
            io.springfox
            springfox-swagger2
            ${swagger}
        
    
        
            io.springfox
            springfox-swagger-ui
            ${swagger}
        
    
        
            io.springfox
            springfox-data-rest
            ${swagger}
        
    
    
    

    application.yaml

    spring:
        data:
            rest: 
                base-path: /v1
    

    java config

    @Configuration
    @EnableSwagger2WebMvc
    @Import(SpringDataRestConfiguration.class)
    public class SwaggerConfig 
    

提交回复
热议问题