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

Graceful handling of invalid JSON #108

Open
Luwdo opened this issue Jul 16, 2024 · 1 comment
Open

Graceful handling of invalid JSON #108

Luwdo opened this issue Jul 16, 2024 · 1 comment

Comments

@Luwdo
Copy link
Contributor

Luwdo commented Jul 16, 2024

I would like for JSON parse failures to result in a 400 bad request invalid JSON.

For example

    @Post('/foo')
    async deleteFoo(@Body({ format: 'json' }) id: string) {
       return {"result":"success"}
    }

If I POST with a body that is not valid JSON it would result in a 400 bad request.

@rezonant
Copy link
Collaborator

As of latest patch release, it returns 500. Let's leave this open to ensure we get 400 for this specific case.

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