记录Swagger2不现实api的坑

 我是用的swagger2的版本

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>2.8.0</version>
        </dependency>

        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>2.8.0</version>
        </dependency>

自从配置了@ComponentScan是怎么运行都不行swagger-ui中的api就是不显示,最后还是灵光一闪将@ComponentScan中的basePackages的路径改为连同swagger.class 和整个controller包含在内才显示

猜你喜欢

转载自blog.csdn.net/yang_ping_cai_niao/article/details/85246682