无法读取文件http://bnp-nice.local:8080/v2/api文档

p8ekf7hl  于 2021-07-13  发布在  Java
关注(0)|答案(0)|浏览(189)

我在我的 swagger 中犯了这个错误。
消息“无法读取文件”http://bnp-nice.local:8080/v2/api docs“有人知道如何解决吗?
请注意,我下面的代码在运行时没有错误https://editor.swagger.io/. 我的招摇配置文件如下。

package io.api.nice;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.PathSelectors;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
@Configuration
@EnableSwagger2
public class SwaggerConfig {                                    
@Bean
public Docket api() { 

    return new Docket(DocumentationType.SWAGGER_2)  
      .select()                                  
      .apis(RequestHandlerSelectors.basePackage( "io.api.nice.controller" ))              
      .paths(PathSelectors.any())                          
      .build();                                           
}
}

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题