Closed NecroKote closed 1 month ago
On the following line:
https://github.com/SMILEY4/ktor-swagger-ui/blob/013161a5c301a331e707e393fecfc13c4e405ec4/ktor-swagger-ui/src/main/kotlin/io/github/smiley4/ktorswaggerui/dsl/routes/OpenApiResponses.kt#L38
statusCode.toString() should be replaced with statusCode.value.toString()
statusCode.toString()
statusCode.value.toString()
Otherwise, the resulting schema contains incorrect values. For example, with code(HttpStatusCode.BadRequest):
code(HttpStatusCode.BadRequest)
"responses": { "400 Bad Request": { "headers": {...}, "content": {...} } }
For the time being, I'm using following workaround:
fun OpenApiResponses.status(code: HttpStatusCode, block: OpenApiResponse.() -> Unit) { return code(code.value.toString(), block) }
Hi, thanks for the info :+1: the bug is fixed and included in version 3.5.0
On the following line:
https://github.com/SMILEY4/ktor-swagger-ui/blob/013161a5c301a331e707e393fecfc13c4e405ec4/ktor-swagger-ui/src/main/kotlin/io/github/smiley4/ktorswaggerui/dsl/routes/OpenApiResponses.kt#L38
statusCode.toString()
should be replaced withstatusCode.value.toString()
Otherwise, the resulting schema contains incorrect values. For example, with
code(HttpStatusCode.BadRequest)
:For the time being, I'm using following workaround: