Swagger 找不到与密钥匹配的模型

Swagger 找不到与密钥匹配的模型,swagger,swagger-ui,springfox,Swagger,Swagger Ui,Springfox,根据以下步骤将Swagger从2.9.2升级到3.0.0: 在新版本中,虽然功能正常工作,但当点击“/swagger ui/index.html”时,日志中会显示以下错误 使用springfox boot starter 3.0.0。非常感谢您的意见 [ReferenceModelSpecificationPropertyConverter]找不到 匹配键的模型 ModelKey{qualifiedModelName=ModelName{namespace='java.time', name=

根据以下步骤将Swagger从2.9.2升级到3.0.0:

在新版本中,虽然功能正常工作,但当点击“/swagger ui/index.html”时,日志中会显示以下错误

使用springfox boot starter 3.0.0。非常感谢您的意见

[ReferenceModelSpecificationPropertyConverter]找不到 匹配键的模型 ModelKey{qualifiedModelName=ModelName{namespace='java.time', name='LocalDate'},viewsdiscriminator=null, ValidationGroupDiscriminator=[],isResponse=true}


根据Springfox文档

将“Date”和“DateTime”类型正确映射到其 相应的招摇类型:

替换“日期”类型(java.util.LocalDate、org.joda.time.LocalDate) 按java.sql.Date

替换“DateTime”类型(java.util.ZonedDateTime, org.joda.time.LocalDateTime…​) 通过java.util.Date


根据Springfox文档

将“Date”和“DateTime”类型正确映射到其 相应的招摇类型:

替换“日期”类型(java.util.LocalDate、org.joda.time.LocalDate) 按java.sql.Date

替换“DateTime”类型(java.util.ZonedDateTime, org.joda.time.LocalDateTime…​) 通过java.util.Date

 docket
    .directModelSubstitute(LocalDate.class, java.sql.Date.class)
    .directModelSubstitute(LocalDateTime.class, java.util.Date.class)