First of all great library support for JSON transformation 😃 👏 Was easy and intuitive on usage of it.
One thing that I noticed is when applying patch to the actual JSON -> if some of the attributes in actual JSON is not present in the operations, we are getting JsonPatchException
ref:
com.github.fge.jsonpatch.JsonPatchOperation#applycom.github.fge.jsonpatch.JsonPatch#apply
And the payload was:
{ "tenant_id":2637,"account_id": 1231232123423}
Since payload has unknown property (tenant_id), this was throwing JsonPatchException exception.
The ask is what if there are some properties which needs no JsonPatch and can stay as it is?
Can we have another implementation which would suppress these exceptions that could happen when there are unknown attributes present in the actual JSON?
First of all great library support for JSON transformation 😃 👏 Was easy and intuitive on usage of it. One thing that I noticed is when applying patch to the actual JSON -> if some of the attributes in actual JSON is not present in the operations, we are getting
JsonPatchException
ref:com.github.fge.jsonpatch.JsonPatchOperation#apply
com.github.fge.jsonpatch.JsonPatch#apply
For instance, I tried the following code snippet
Here the specJson was:
{ "op": "move", "from": "/account_id", "path": "/app_id" }
And the payload was:
{ "tenant_id":2637,"account_id": 1231232123423}
Since payload has unknown property (tenant_id), this was throwing
JsonPatchException
exception. The ask is what if there are some properties which needs no JsonPatch and can stay as it is?Can we have another implementation which would suppress these exceptions that could happen when there are unknown attributes present in the actual JSON?