Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description for response #135

Open
LeatherDeerAU opened this issue Mar 17, 2023 · 1 comment
Open

Description for response #135

LeatherDeerAU opened this issue Mar 17, 2023 · 1 comment

Comments

@LeatherDeerAU
Copy link

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 LeatherDeerAU changed the title Description for answers other than OK. Description for response Mar 17, 2023
@Wicpar
Copy link
Collaborator

Wicpar commented Mar 17, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants