-
Notifications
You must be signed in to change notification settings - Fork 30
Need to provide ID when updating (PATCH) even though the URL contains the ID. #26
Comments
Thanks for reporting this! This is definitely a bug in https://www.drupal.org/project/jsonapi. |
Actually… turns out that the JSON API spec requires this: http://jsonapi.org/format/#document-resource-objects. |
This makes sense at some level, but the spec seems to say that you need both |
You're right! Issue created: https://www.drupal.org/node/2888889. |
Client applications should be written to conform to the JSON API spec, as that (hopefully) ensures that they will be compatible with all implementations of the JSON API spec. That's the reason for the spec, after all. I think it's bad practice to expend extra effort only to enable poorly implemented clients to be created. |
@chris-hamper It's late here, so maybe that's why, but … I'm not sure I see what the point is that you're making? |
I guess the idea is that everyone should provide It seems like Drupal doesn't require both right now and let's through requests that have enough for it to know what to do. So, either Drupal JSON API should require both (and probably break sites) or require neither. |
@chris-hamper also commented at https://www.drupal.org/node/2888889#comment-12141288 — given that, I think his comment was really just supporting @damontgomery's remark/argumentation :) |
As described in the wiki guide, https://github.com/acquia/reservoir/wiki/Quick-Start-Guide#update-an-article
You need to make a request like,
PATCH
to/jsonapi/node/article/141962d7-2180-4419-bb8e-a9c1d337aeb2
with body
Which seems a bit unnecessary since the URL already contains the ID and I don't think you can pass multiple pieces of content at the same time.
The text was updated successfully, but these errors were encountered: