Open APIs

 View Only
  • 1.  JSON Merge Patch format in PATCH method

    TM Forum Member
    Posted Jul 15, 2020 08:08
    Hi,

    I have a question regarding TMF641 Service Ordering API User Guide v4.0.0. In Patch service order section the document requires support of json/merge format. Below in Usage Samples partial update of "orderItem" array is shown.

    But according to JSON Merge Patch specification (https://tools.ietf.org/html/rfc7396) partial update of an array is not possible: "There are a few things to note about the function. If the patch is anything other than an object, the result will always be to replace the entire target with the entire patch. Also, it is not possible to patch part of a target that is not an object, such as to replace just some of the values in an array."

    Could you please explain how arrays should be handled for JSON Merge Patch format in HTTP PATCH method?

    ------------------------------
    Sergei Fedorov
    T-Systems International Services GmbH
    ------------------------------


  • 2.  RE: JSON Merge Patch format in PATCH method

    TM Forum Member
    Posted Jul 19, 2020 01:11
    Hi Sergei

    In principle we should support both types of Patch, the operation-based variation https://tools.ietf.org/html/rfc6902 and the merge that you mention https://tools.ietf.org/html/rfc7386 .
    But I suspect that most of the examples in our API user guides use the merge syntax since it's easier to create those examples - I know that's what I did in the APIs that I did examples for.
    And arrays would presumably need to be modified only by operation-based patch.
    It should be covered in the TMF630 design guidelines, @Alexis De Peufeilhoux .

    It's possible that you have encountered an error in the specific example, adding @Ludovic Robert for comment.​

    Thanks for bringing this to our attention.



    ------------------------------
    Jonathan Goldberg
    Amdocs Management Limited
    Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
    ------------------------------



  • 3.  RE: JSON Merge Patch format in PATCH method

    TM Forum Member
    Posted Jul 20, 2020 04:55
    Thank you, Jonathan!

    ------------------------------
    Sergei Fedorov
    T-Systems International Services GmbH
    ------------------------------



  • 4.  RE: JSON Merge Patch format in PATCH method

    TM Forum Member
    Posted Jul 20, 2020 10:50

    Hello,

     

    We have implemented some of the Catalog related Open APIs and we came into the same issue as well.

     

    Currently, some of the catalog related APIs state that json-merge is mandatory but, states that patch-json

    is not.

     

    This is the text that is there on those APIs: (520, 533, 534)

    (..) This operation allows partial updates of a catalog 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 assume that there's a mistake on this text as rather than 5789, I assume that the original idea was to refer to 6902.

    5789 has nothing to do with json but 6902 does.

     

    Anyways, if the norm will be to make it required to accept 6902 as well as suggested on previous answer, I think that this

    indication must be reflected on a new version of these catalog APIs as well, right?

     

    Another detail that I believe would it be really handy on these Catalog APIs is that they should make reference to

    the TMF630.

     

    Regards