TMF622 Release 19 States that support for json/merge (https://tools.ietf.org/html/rfc7386) is mandatory (called JSON Merge Patch in the RFC).
See pp65 of the TMF 622 spec
"This operation allows partial updates of a product order entity. Support of json/merge (https://tools.ietf.org/html/rfc7386) is mandatory, support of json/patch (http://tools.ietf.org/html/rfc5789) is optional."
I have read through RFC 7386 (and RFC 7396 which replaces it) and it states that patching an array results in the verbatim replacement of the existing array with the patch array. I.e. there is no matching and recursive merging of objects in the array. See RFC 7396 [Page 4].
This means the example starting on TMF622 page 71 (Change value for billing account id) does not comply with the RFC. The example implies a patching behaviour where the OrderItems in the productOrderItem array are matched on id and then the JSON Merge algorithm applied to each one. But this is not the behaviour in the RFC, the RFC behaviour would be to replace the productOrderItem array in its' entirety with the array as it appears in the patch, without merging.
Have I miss-understood? I know tools like the python jsonmerge can do this sort of thing, but that is not what the RFC describes.
I can see various options:
- The example in the spec should be changed to align with JSON Merge Patch RFC 7396 (which updates RFC 7386)
- The spec should not reference the RFC but instead define its' own behaviour, some other RFC I have missed?
- The TMF could suggest updates to RFC 7396
In addition, RFC 5789 is not the spec for JSON Patch but the spec for HTTP Patch. I think the spec meant to reference RFC 6902 JavaScript Object Notation (JSON) Patch?
------------------------------
Alasdair MacLeod
BT Group plc
------------------------------