support JSON Merge Patch (RFC 7396) diff creation#4965
support JSON Merge Patch (RFC 7396) diff creation#4965satelliteprogrammer wants to merge 1 commit intonlohmann:developfrom
Conversation
The JSON merge patch document format describes the set of modifications to a resource's content, that more closely mimics the syntax of the resource being modified. However, and in contrast to JSON Patch (RFC 6902), a JSON Merge Patch cannot express certain modifications, e.g., changing an array element at a specific index, or setting a specific object value to null. The null value in a JSON Merge Patch is used to remove the key from the object. The diff algorithm is not part of the RFC 7396, but it was tested against all examples provided, plus additional cases on how null values are handled.
🔴 Amalgamation check failed! 🔴The source code has not been amalgamated. @satelliteprogrammer |
|
I am not sure if this feature would be widely used, so I'm opening a discussion. |
|
We had a (somewhat niche) need for this at work, that's why I've contributed here. It's essentially a combination of 2 things:
For very large data structures, reading through a log line to find the one variable that did change is a pain. Not only that, but on some interfaces only a small amount of member variables on the entire structure are actually changing. |
|
This pull request has been marked as stale because it has had no activity for 30 days. While we won’t close it automatically, we encourage you to update or comment if it is still relevant. Keeping pull requests active and up-to-date helps us review and merge changes more efficiently. Thank you for your contributions! |
The JSON merge patch document format describes the set of modifications to a resource's content, that more closely mimics the syntax of the resource being modified.
However, and in contrast to JSON Patch (RFC 6902), a JSON Merge Patch cannot express certain modifications, e.g., changing an array element at a specific index, or setting a specific object value to null. The null value in a JSON Merge Patch is used to remove the key from the object.
The diff algorithm is not part of the RFC 7396, but it was tested against all examples provided, plus additional cases on how null values are handled.
JSON Merge Patch PR: #876
PR discussing the diff: #2018
If the content is approved, please let me know if/what documentation needs to be updated.
[Describe your pull request here. Please read the text below the line and make sure you follow the checklist.]
make amalgamate.Read the Contribution Guidelines for detailed information.