【发布时间】:2019-06-19 20:33:29
【问题描述】:
Swagger-ui 在编辑和无编辑模式下显示重复的模型变量。这发生在 ui 上显示的每个模型都有重复的模型变量。不确定这是否是由于使用了 kotlin,但它确实令人沮丧和困惑。重复变量似乎在每个变量之后都有 $timefundcharity 。
每个模型也是一个带有 @Document 注释的 MongoDb 实体
欢迎任何帮助
{
"charityId$charity": 0,
"createdAt$charity": "2019-06-19T20:16:33.735Z",
"id": 0,
"id$charity": 0,
"userId": 0,
"userId$charity": 0,
"charityId": 0,
"createdAt": "2019-06-19T20:16:33.735Z"
}
我在互联网上查看了如何解决这个问题,但似乎没有人真正遇到过这个问题,并认为我最好在这里联系。
起初我以为可能是招摇的配置,但似乎也不是,因为我已经将配置与其他来源进行了比较
@Document(collection = "CharityFollowers")
@ApiModel
data class CharityFollower
(
internal var userId: BigInteger,
internal var charityId: BigInteger,
internal var createdAt: LocalDateTime = LocalDateTime.now()
){
@Id internal lateinit var id : BigInteger
}
招摇配置
@Bean
fun productApi(): Docket {
return Docket(DocumentationType.SWAGGER_12)
.select()
.apis(RequestHandlerSelectors.basePackage("com.martin.charity.controllers"))
.build()
.securityContexts(arrayListOf(securityContext()))
.securitySchemes(arrayListOf(this.securitySchema(), this.apiKey(), this.apiCookieKey()))
}
我希望结果没有重复的模型变量
【问题讨论】:
标签: java spring-boot kotlin swagger swagger-ui