Java 大摇大摆的用户界面不使用JSON配置
我删除了@EnableSwagger2&io.springfox:springfox-swaggger2依赖项,以便不使用传统的与swagger相关的注释,而是使用JSON文件 我已使用此处共享的详细信息将招摇从基于注释更改为基于JSON: 但现在它正在显现Java 大摇大摆的用户界面不使用JSON配置,java,spring,swagger,swagger-ui,Java,Spring,Swagger,Swagger Ui,我删除了@EnableSwagger2&io.springfox:springfox-swaggger2依赖项,以便不使用传统的与swagger相关的注释,而是使用JSON文件 我已使用此处共享的详细信息将招摇从基于注释更改为基于JSON: 但现在它正在显现 有人能帮我解决问题的原因吗?我认为您没有在Pom.xml文件中添加招摇依赖项: <dependency> <groupId>io.springfox</groupId>
有人能帮我解决问题的原因吗?我认为您没有在Pom.xml文件中添加招摇依赖项:
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.5.0</version>
</dependency>
我有这种依赖关系,它工作得很好,但我正试图在没有这种依赖关系和任何与招摇过市相关的注释的情况下做同样的事情。参考:@helen不,实际上所有这些问题都使用了“@EnableSwagger2”和相关注释,但我想使用JSON而不是那些注释。参考:
@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select()
.apis(Predicates.not(RequestHandlerSelectors.basePackage("org.springframework.boot")))
.apis(Predicates.not(RequestHandlerSelectors.basePackage("org.springframework.cloud")))
.apis(Predicates.not(RequestHandlerSelectors.basePackage("org.springframework.data.rest.webmvc")))
.paths(PathSelectors.any()).build();
}}