-
Notifications
You must be signed in to change notification settings - Fork 14
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
Support for JsonPatch
and JsonMergePatch
defined in JSON-P 1.1
#13
Comments
First of all, thank you for suggesting this! I assume this refers to a newer reversion of JSON-P, 1.1? 1.0 does not have these types, but: https://static.javadoc.io/javax.json/javax.json-api/1.1/overview-summary.html So this would require an update to Assuming that factory method (and serialization counterpart) is easy, which sounds like it is, I think this makes sense. |
JsonPatch
and JsonMergePatch
defined in JSON-P 1.1
You're right. It's actually defined in JSON-P 1.1 specification - JSR374 (BTW Apache Johnzon Project contains wrong statement on their project webpage). Maybe a better solution would be to create another module, which would extend this one instead of modifying this one. Also there is one more type which someone would like to use: JsonPointer |
I think it's probably ok to add it here, even if it becomes bit of misnomer. |
I've just created PR for this issue: #14. I guess it resolves this problem. Please share your thoughts. Thanks. |
@cowtowncoder can we do something with this issue, according to RC of jackson-core? Also, I updated the code and changed base in PR |
@regulskimichal Apologies for totally missing follow up on this. First thoughts: looks good, although I wish indentation etc was not reformatted as that makes diff more verbose. But that aside, the only real concern I have is that there are no unit tests to cover support for types. It would be great to have just sanity checks, and to show expected usage. Another question I have is about having 2 separate modules. I can see why this might be kind of useful but curious whether it might just be simpler to extend existing module. But beyond that, I am happy to get this merged. But before that, one practical thing I need (if I didn't ask for it yet -- apologies if I did): CLA. It can be found here: https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf and is easiest usually to just print, fill & sign, scan/take photo, email to With that (only needs to be done once for any contributions to Jackson projects), I could merge the PR. Thank you again! |
Thank you for your commitment. I made some changes according to your remarks. Please check if it satisfies you. Meanwhile, I sent a CA to the company email box. |
Excellent, thank you for providing these very quickly! I'll have a look and I think this will now make it into 2.11.0 (I am about finalize the release) which should be good. |
Looks good: merged as-is. One other thing: it would be great to add mention in Once again: thank you for the contribution and apologies for slow follow up. |
JsonPatch and JsonMergePatch are defined as interfaces so the implementation class depends on library implementing it. Thanks to these deserializers, it is possible to use these types in much easier way without boilerplate. I needed this feature, because thanks to this module, I will be able to use JsonPatch and JsonMergePatch directly in Spring HTTP method handlers. I don't feel comfortable to write documentation in English, so you can use this information as you want. |
@regulskimichal Thank you; that is fine, I can add something based on this! One other note: I will likely move JSR-353 datatype module under new multi-project repo: https://github.com/FasterXML/jackson-datatypes-misc/ for 2.11. Will update READMEs here, but thought I will mention it now so you won't be surprised (or if there are changes to be made). |
I got two more thoughts about this:
|
yes, it could be considered jsr-374 possibly now. As to including support in core: jackson-core and jackson-databind intentionally keep their dependencies minimal, and I do not want to add new dependency there. |
https://tools.ietf.org/html/rfc6902 and https://tools.ietf.org/html/rfc7386. |
@regulskimichal Ah! Yes, that could make sense, although not sure if to |
I guess this feature is quite useful (makes PATCH method in REST-style app easy to implement) and quite not well-known, but should be. When I will have more time I can provide some commits to make it possible, also with Kotlin extensions. |
JSR353 defines also JsonPatch and JsonMergePatch type. These types should not be instantiated via reflection, but using Json.createPatch() and Json.createMergePatch(), which are methods that use SPI. IMO library should provide support for these types.
The text was updated successfully, but these errors were encountered: