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

Update operation for resource without an ID should fail #373

Closed
jimsteel opened this issue May 24, 2016 · 2 comments
Closed

Update operation for resource without an ID should fail #373

jimsteel opened this issue May 24, 2016 · 2 comments

Comments

@jimsteel
Copy link

Doing a PUT on a resource that doesn't have an ID in the body should fail with 400, but succeeds (and copies the id from the URL into the resource. Related to #305

@jamesagnew
Copy link
Collaborator

This is actually something we recently changed to make the server a bit more tolerant of user error. When doing a create:

  • If the ID in the resource body and the URL don't agree, the server rejects the request with HTTP 400
  • If the resource body has no ID and the URL has one, the server logs a warning (iirc?) but ultimately lets the operation through

Obviously this is contrary to the spec, but it seems like this is a place where applying Postel's law makes sense since the user's intentions are fairly clear. Would it make sense to add a "strict" mode where this kind of thing results in an error?

@jamesagnew
Copy link
Collaborator

Fixed in #521

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