Ktor-OpenAPI-Generator icon indicating copy to clipboard operation
Ktor-OpenAPI-Generator copied to clipboard

Description for response

Open LeatherDeerAU opened this issue 2 years ago • 1 comments

I want to get an analog

responses:
    '400':
        desctiprion: "Parse error"

But with code below i just get "Bad request" in description

apiRouting {
    route("example/create") {
        throws(
            HttpStatusCode.BadRequest,
            ExceptionExampleDto("Cannot parse"),
            { ex: Error -> ExceptionExampleDto(ex.message!!) }) {
                ...
       }
}

Is it possible?

LeatherDeerAU avatar Mar 17 '23 15:03 LeatherDeerAU

the description is generated from the status code IIRC, try to create a new status code with HttpStatusCode(400, "Parse error")

Wicpar avatar Mar 17 '23 16:03 Wicpar