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

Failed PUTs return 200 #1

Closed
ethanresnick opened this issue Oct 24, 2014 · 1 comment
Closed

Failed PUTs return 200 #1

ethanresnick opened this issue Oct 24, 2014 · 1 comment
Labels

Comments

@ethanresnick
Copy link
Owner

If you PUT to a resource, and the data you're PUTting is in the right format but the db rejects it (e.g. because it fails to pass validation rules)...

  1. The resource isn't actually modified in the database (good!), but
  2. the server returns a 200 with the body holding the contents of the resource as it would be if the update had succeeded.
@ethanresnick
Copy link
Owner Author

This has been fixed. Here's the relevant line, which uses 400 for validation errors and otherwise tries to make an intelligent status code decision: https://github.com/ethanresnick/json-api/blob/master/src/adapters/Mongoose/lib.js#L20

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

No branches or pull requests

1 participant