-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Outline what happens on well formed but invalid data #13
Comments
throwing in my 2 cents - i'm guessing either 400 or 403 would be the right code status 400
your question sounds like you think 400 might not be right since the JSON syntax was not malformed. status 403
i lean towards 403 because the server has understood the JSON but is refusing to use it and it's not an authorization issue. also, with 403, the server is permitted to provide a reason for refusal in the response. |
I could go either way (400 or 403). It is well formed JSON but it is malformed or at least non-validating compared to the schema. I believe we presently are using 400 within the platform API, along with a json body that has an error id and error message in plain text. You can see some examples of that in committee's README here: https://github.com/interagent/committee#committeemiddlewarerequestvalidation |
I think I landed on 400's in Committee, but I'm open to suggestions on the On Fri, May 30, 2014 at 10:55 PM, Wesley Beary [email protected]
|
I've been using 422 (along with an explanation in the response code), but I'm not sure how well that follows RFC 4918. |
If someone posts well formed JSON that is invalid, what http error status is returned and what is the format of the error response?
For purposes of an example, assume that app_name does not allow spaces, what would be the response and status to this?
POST /apps
{"app_name": "foo bar":}
The text was updated successfully, but these errors were encountered: