Open APIs

 View Only
  • 1.  Using TMF630 (REST API Guidelines) in conjunction with TMF620/TMF622

    Posted Jul 12, 2023 20:28

    Hello TMFORUM community,

    We basically follow the format specified in TMF 630 REST API Guidelines (v4.2.2) - Section 6.2. Creating Multiple Resources - JSON PATCH for all our APIs since there is a capability to create, modify, remove multiple resources at the same time.

    It basically means an op of add, remove, replace, modify is supported via PATCH, a basic example shown below. 

    PATCH /api/anycustomapi
    Content-type: application/json-patch+json
    [
      {
      "op": "add",
      "value": {
      "id": "42", .....

       },

      {
      "op": "remove",
      "value": {
      "id": "43".....

       }

    ]

    Most of the other TMF Open API specs use POST for creation and PATCH for partial updates. In this case, let's take the example of a POST /productSpecification in TMF 620. There is no mention in this document of supporting multiple requests with an API.

    If we wanted to create multiple product specifications with an API and use TMF 620/TMF 622, is it still acceptable to use JSON PATCH for this purpose i.e to not support POST, PATCH for creates and updates and instead support JSON PATCH for creates, updates, removes ? 

    Example:

    [
      {
      "op": "add",
      "value": {
      "name": "Data Recurring Specification"
    ....................

       },

      {
      "op": "remove",
      "value": {
      "id": "43",
     .....

       }

    ]



    ------------------------------
    Remya
    ------------------------------


  • 2.  RE: Using TMF630 (REST API Guidelines) in conjunction with TMF620/TMF622

    Posted Jul 13, 2023 01:36

    Hi Remya

    The JSON Patch syntax is intended exactly for that, PATCH. It cannot be used to create or delete top-level entities.

    You are correct that we don't currently have in TMF Open API a pattern or syntax for operations on multiple top-level entities (let's call that Bulk or Mass activities). The challenge with bulk operations is how to deal with partial failures (how to report them, whether to continue or stop after first failure, etc.). You could of course build your own framework on top of the Open API entity operations.

    Hope it helps



    ------------------------------
    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: Using TMF630 (REST API Guidelines) in conjunction with TMF620/TMF622

    Posted Jul 13, 2023 19:13

    yes, that makes sense. Thanks Jonathan. 



    ------------------------------
    Remya Rajesh
    CSG
    ------------------------------