papsign / Ktor-OpenAPI-Generator

Ktor OpenAPI/Swagger 3 Generator
Apache License 2.0
241 stars 42 forks source link

Description for response #135

Open LeatherDeerAU opened 1 year ago

LeatherDeerAU commented 1 year ago

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?

Wicpar commented 1 year ago

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