-
Notifications
You must be signed in to change notification settings - Fork 43
Open
Description
I am trying to use @Description to my schema model.
my version is 0.3-beta.2
But nothing happen to my schema model.
Am I using @Description annotation incorrectly? Or @Description is working improperly?
this is my code as shown below.
can I get any advice?
fun NormalOpenAPIRoute.regionSpec() {
route("/api/regions") {
get<Unit, RegionResponse>(
info("show regions")
) {
respond(RegionResponse.of("seoul", 1, "seoul city"))
}
}
@Response("Region")
data class RegionResponse(
@Description("city") val sido: String,
@Description("region id") val regionId: Int,
@Description("region name") val region: String
) : Serializable {
companion object {
fun of(sido: String, regionId: Int, region: String) =
RegionResponse(sido = sido, regionId = regionId, region = region)
}
}
"components" : {
"schemas" : {
"RegionResponse" : {
"nullable" : false,
"properties" : {
"region" : {
"nullable" : false,
"type" : "string"
},
"regionId" : {
"format" : "int32",
"nullable" : false,
"type" : "integer"
},
"sido" : {
"nullable" : false,
"type" : "string"
}
},
"required" : [ "region", "regionId", "sido" ],
"type" : "object"
}
}
}
craigberry1
Metadata
Metadata
Assignees
Labels
No labels