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

Return 400 instead of 405 for invalid input #56

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nrktkt
Copy link

@nrktkt nrktkt commented Feb 23, 2021

405 is "Method Not Allowed" which seems unlikely to be what we want. A generic 400 "Bad Request" seems like a better status for our documented message of "Invalid input".

I was also inclined to combine some of these 400 "Invalid ID supplied" statuses into the 404s defined for the same method, but I understand that the 400 is probably meant to say "you passed a non-int id, so I'm not going to bother looking for your resource" as opposed to "I looked for your resource but couldn't find it".

405 is "Method Not Allowed" which seems unlikely to be what we want. A generic 400 "Bad Request" seems like a better status for our documented message of "Invalid input".

I was also inclined to combine some of these 400 "Invalid ID supplied" statuses into the 404s defined for the same method, but I understand that the 400 is probably meant to say "you passed a non-int id, so I'm not going to bother looking for your resource" as opposed to "I looked for your resource but couldn't find it".
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

Successfully merging this pull request may close these issues.

1 participant