1 回答

TA貢獻(xiàn)2051條經(jīng)驗(yàn) 獲得超10個贊
在大搖大擺的配置中試試這個
directModelSubstitute將解決這個問題
@Bean
public Docket postsApi() {
return new Docket(DocumentationType.SWAGGER_2)//.groupName("public-api")
.groupName("")
.directModelSubstitute(LocalDateTime.class, String.class)
.directModelSubstitute(LocalDate.class, String.class)
.directModelSubstitute(LocalTime.class, String.class)
.directModelSubstitute(ZonedDateTime.class, String.class)
.apiInfo(apiInfo())
.select()
.apis(RequestHandlerSelectors.withClassAnnotation(RestController.class))
.paths(PathSelectors.any())
.paths(postPaths()).build().useDefaultResponseMessages(false)
.globalResponseMessage(RequestMethod.GET, getCustomizedResponseMessages());
}
添加回答
舉報