I've posted the complete use case to SO:
https://stackoverflow.com/questions/48194222/missing-bridge-between-json-b-and-json-apis
In short:
In order to implement HTTP PATCH restful method, I'm using JSON processing to apply a JSON PATCH to a DTO annotated with JSON-B. The problem is quite simple: JSON-B converts an object from / to a JSON representation which is serialized / deserialized in a String, resulting in the following strategy to apply a patch:
- Use JSON-B to convert the DTO into a JSON representation (String)
- Use JSON processing to convert the JSON representation into a JsonObject
- Apply the JSON patch
- Use JSON processing to convert the result into a JSON representation (String)
- Use JSON-B to convert the JSON representation into the original DTO form.
A bridge between both libraries would be great, or if such dependencies are not desired, implementing JSON patch + bean validation to JSON-B would be great.