-
Notifications
You must be signed in to change notification settings - Fork 93
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
Wrong patch format WRT the standard RFC 6902 #96
Comments
Thanks for the suggestions. I don't think dictdiffer was ever meant to generate patches according to JSONPatch, and dictdiffer also diffs more than just JSON. You could add a new feature to support output in JSONPatch, but not sure how much work is involved with that. |
Is the current patch format documented in any other way except in the tests? I am thinking of some kind of a grammar that we adhere to. |
It's part of the |
I agree that the docstring contains a number of excellent examples, but it still leaves it to the reader to infer what the rules are, especially as it is all plain values with no keys. I am thinking of something simple but explicit like this:
If we can make sure that the above is correct and complete, I can PR it to the docstring. And for some reason, I really do not "get" |
@mikaelho the PR with a description from your comment is welcome 🙏 |
This is the test that I run
This is the result of the previous code:
In according to the standard RFC 6902 that defines: a JSON document structure for expressing sequence of operations to apply to a JavaScript Object Notation (JSON) document; (https://tools.ietf.org/html/rfc6902)
IMHO the result is wrong for 2 reasons:
It is not wrapped in an object (but is a minor issue, tuples are fine)
The format of the response is wrong because is not returning the key
foo
in the right place. This force users to handle different cases and build manually the path for a given patch.The text was updated successfully, but these errors were encountered: