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

Use 400 Bad Request for FailedToDeserializeQueryString rejections #1387

Merged
merged 2 commits into from Sep 18, 2022

Conversation

davidpdrsn
Copy link
Member

Fixes #1378

From the spec about 422 Unprocessable Entity:

For example, this error condition may occur if an XML request body
contains well-formed (i.e., syntactically correct), but semantically
erroneous, XML instructions.

I understand this to mean that query params shouldn't use 422 because that is about the request body.

So this changes FailedToDeserializeQueryString from 422 Unprocessable Entity to 400 Bad Request.

Motivation

Solution

Fixes #1378

From [the spec] about `422 Unprocessable Entity`:

> For example, this error condition may occur if an XML request body
> contains well-formed (i.e., syntactically correct), but semantically
> erroneous, XML instructions.

I understand this to mean that query params shouldn't use 422 because
that is about the request body.

So this changes `FailedToDeserializeQueryString` from `422 Unprocessable
Entity` to `400 Bad Request`.

[the spec]: https://datatracker.ietf.org/doc/html/rfc4918#section-11.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong query string should yield 400, not 422
2 participants