@ApiResponses(Array(
new ApiResponse(code = 200, message = "OK", response = classOf[ResultBase]),
new ApiResponse(code = 500, message = "Internal server error"),
))
这是我的特点:
@ApiModel(value="Event", description="Base class for events")
sealed trait ResultBase {
@(ApiModelProperty @field)(value = "Id")
val id: String
}
这是我在swagger.json
中得到的"responses" : {
"200" : {
"description" : "OK",
"schema" : {
"$ref" : "#/definitions/ResultBase"
}
},
"500" : {
"description" : "Internal server error"
}
}
但是,在Swagger-ui
中,Schema和Schema Model都是空的。
有什么方法吗?