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

Part 4: Support for JSON Patch (RFC 6902) #957

Open
rhysrevans3 opened this issue Oct 14, 2024 · 3 comments
Open

Part 4: Support for JSON Patch (RFC 6902) #957

rhysrevans3 opened this issue Oct 14, 2024 · 3 comments

Comments

@rhysrevans3
Copy link

The current specification suggests PATCH endpoints should use JSON Merge Patch (RFC 7396).

However in JSON Merge Patch null values are given special meaning to indicate the removal of existing values in the target.

Which isn't recommended for documents that allow explicit null values which I believe OGC Features allow.

This design means that merge patch documents are suitable for
describing modifications to JSON documents that primarily use objects
for their structure and do not make use of explicit null values.

Could JSON Patch (RFC 6902) be supported alongside JSON Merge Patch (RFC 7396)? Which allows for operations (add, remove, replace, move, copy, test) to be declared which allows the setting of null values.

The Accept/Content-Type header for JSON Patch (application/json-patch+json) is different than that of JSON Merge Patch (application/merge-patch+json) so these can both be supported at the same time.

Alternately, can it be made explicit that although JSON Merge Patch is recommended it does not have to be used exclusively to the exclusion of any other standards.

@pvretano
Copy link
Contributor

@rhysrevans3, yes, JSON Patch could be used alongside JSON Merge Patch. I would say you should advertise the appropriate JSON Patch media type at the appropriate endpoint in the server's OpenAPI document but beyond that you should be good to go.

@pvretano
Copy link
Contributor

pvretano commented Oct 14, 2024

We should still probably add a disclaimer that JSON Merge Patch is not exclusive. My server, for example, also supports the old WFS Transaction XML encoding for updates alongside JSON Merge Patch.

@rhysrevans3
Copy link
Author

@pvretano Brilliant thank you!

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

No branches or pull requests

2 participants