
用MybatisPlus-generator生成的帶Swagger注解物體類,然后隨便寫了幾個只有方法簽名的介面(Swagger注解也寫上了)想測驗能不能正常運行,結果只有如圖結果
在提問之前已經確保以下細節并無問題:
1. 物體類和介面的Swagger注解
2. SpringBoot啟動主方法上加上@EnableSwagger2注解
3. Swagger配置類
@Configuration
@EnableSwagger2
@ComponentScan("com.common.controller")
public class SwaggerConfig {
@Bean
public Docket api() {
return new Docket(DocumentationType.SWAGGER_2)
.apiInfo(apiInfo())
.pathMapping("/")
.select()
.apis(RequestHandlerSelectors.any())//
.apis(RequestHandlerSelectors.basePackage("com.common.controller"))
.build();
}
private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("介面檔案")
.version("1.0.0")
.termsOfServiceUrl("")
.license("")
.licenseUrl("")
.build();
}
}
在相關問答下面也發現過fastjson版本過低的可能,(評論原話“升級下fastjson的版本到1.2.15 + 以上 我用的是1.2.28”)
但已檢查過MP的依賴中fastjson的版本高達1.2.72
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/273458.html
標籤:Java相關
上一篇:使用JSTL資料庫c:out標簽的值怎么傳值到java代碼
下一篇:Java中為什么獲取字串長度用str.length(),獲取陣列長度用.length,以及集合的size()方法
