-
-
Notifications
You must be signed in to change notification settings - Fork 874
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
JSON PATCH support #759
Comments
It would definitely be a great improvement to have support for JSON PATCH. |
On the other end, JSON Merge Patch will be easier to implement, and easier to use client-side. |
@dunglas given that the content-type of both methods is different, couldn't both be implemented? I understand that Merge Patch has limitations, but for many cases, it's simplicity could be great for certain applications. What I mean is, I don't see why we should have to pick one or the other. They are just different formats and both could be supported. If that's ok with you, I might have a go at trying to implement merge patch, time permitting. |
Yew we can support both. It should be possible to support JSON MERGE PATCH with just a few modifications to the current system. |
Implementing JSON Patch will force us to improve our design. And it will allow us to deprecate the current partial PUT semantics (which is wrong). 😄 |
@teohhanhui I don't see why both (JSON MERGE and JSON PATCH) can't be implemented. I don't disagree with you and I'm sure if a PR appears for JSON PATCH, @dunglas would be willing to merge assuming it passes review. In my use-case, the simplicity of JSON MERGE trumps the flexibility of JSON PATCH. |
I'm okay with having both. :)
…On 27 Feb 2017 22:19, "Alberto Simon" ***@***.***> wrote:
@teohhanhui <https://github.com/teohhanhui> I don't see why both (JSON
MERGE and JSON PATCH) can't be implemented. I don't disagree with you and
I'm sure if a PR appears for JSON PATCH, @dunglas
<https://github.com/dunglas> would be willing to merge assuming it passes
review. In my use-case, the simplicity of JSON MERGE trumps the flexibility
of JSON PATCH.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#759 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAhf615IQF9pQkU8tZdIzn-8SG20cehuks5rgttugaJpZM4KBoyo>
.
|
Also, I think we can deprecate the partial PUT once we have JSON Merge Patch.
Because it already covers the existing semantics.
…On 28 Feb 2017 11:53, "Teoh Han Hui" ***@***.***> wrote:
I'm okay with having both. :)
On 27 Feb 2017 22:19, "Alberto Simon" ***@***.***> wrote:
> @teohhanhui <https://github.com/teohhanhui> I don't see why both (JSON
> MERGE and JSON PATCH) can't be implemented. I don't disagree with you and
> I'm sure if a PR appears for JSON PATCH, @dunglas
> <https://github.com/dunglas> would be willing to merge assuming it
> passes review. In my use-case, the simplicity of JSON MERGE trumps the
> flexibility of JSON PATCH.
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#759 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAhf615IQF9pQkU8tZdIzn-8SG20cehuks5rgttugaJpZM4KBoyo>
> .
>
|
anyone actively working on this? |
AFAIK, no. But we should probably consider using JSON Merge Patch instead: https://tools.ietf.org/html/rfc7386 |
JSON API is only one media type. This is about PATCH support for all of the supported media types, and I'd think especially JSON-LD / Hydra. |
@dunglas IMO this shouldn't be closed in favor of JSON Merge since Merge is only a partial PUT. JSON PATCH is a diff to a JSON document so, if a document represents a collection of your resources, you could:
It solves the partial collection management problem well and IMO it should be kept as a future option. |
this seems a step too far at the moment. EDIT: from slack it seems not that hard? we know what attributes are writable for the
|
@bendavies Yes, but we need to make it opt-in for BC. And when we have proper JSON Patch support, we can deprecate not using the correct semantics. |
JSON Merge Patch support has landed in 2.5. |
Let's keep this open as we only support JSON Merge Patch, not JSON Patch. |
#Hi, how do you manage partial Validation constraints with PATCH actions? I opened an issue here: |
I am attempting to implement a subset of JSON Patch/RFC 6902 in order to partially update collections. See discussion #4882. |
#147 suggested adding a PATCH support for partials updates, it was closed as PUT already does that.
How about adding a JSON PATCH support? Difference here is you're able to do operations WITH entities, not only ON entites, quoted from Why PATCH is Good for Your HTTP API
The text was updated successfully, but these errors were encountered: