Open APIs

 View Only
  • 1.  TMF630 - PATCH resource avoiding full object response

    TM Forum Member
    Posted 22 days ago

    Hello Team

    I´ve been struggling to implement a compliant response in TMForum OpenAPIs when we need to PATCH a resource but can´t return the full representation of the resource, or the performance of that return would not be appropriate in our system.
     
    So the question is: ¿Im which cases a TMForum open API PATCH method can avoid returning the full resource on the response? Can this be done via HTTP 204 status code or attribute selection to be compliant?
     
    In my opinion, in the context of TM Forum RESTful APIs, the response to a PATCH call SHOULD not always have to contain the modified object. It should be possible to give a response without a body, especially if the update was successful and there is no additional information that needs to be returned to the client. Still, the TMF630 API Design Guidelines are not pretty clear about this point.
     
    In one hand, at TMForum TMF630 guidelines 4.0.2 Pagina 53 seccion 6.2. Creating Multiple Resources with json-patch+json we can find this statement "A successful PATCH must return either 200 OK HTTP code or a 204 No Content" but on the other hand in section 5.3. Modify Attribute subset of a resource we don´t find the HTTP 204 in the response codes table it seems to be limited to "If the request is successful then the returned code MUST be 200 OK".
     
    I have been evaluating also the attribute seleccion for this purpose, and we see an example in TMF630 specification page 59 applying attribute selection to a POST operation:
     
    POST /api/troubleTicket?fields=none
    Content-Type: application/json
    With this response:
     
    201 Created
    Location: http:server:port/troubleTicletManagement/troubleTicket/42
    Content-Type: application/json
    {
    "id": "42",
    "href":" /troubleTicketManagement/troubleTicket/42"
    ... // Full representation of the resource
    }
     
     
    It is a disconcerting example because POST and PATCH operations seems not to support filter query parameter if you read the specs, so ¿that response is incorrect because the full represention is misplaced? or is it incorrect because the "fields" query parameter is not allowed in the POST operation in TMF621? or is it correct and can be used in a PATCH operation in the same way as the above example does?

    Thanks in advance,


    ------------------------------
    Miguel Santasmarinas
    Vodafone Group
    ------------------------------


  • 2.  RE: TMF630 - PATCH resource avoiding full object response
    Best Answer

    TM Forum Member
    Posted 21 days ago

    Yes, it's the fields query parameter which you want, it conveys your intention to have the response filtered to receive only those requested (plus mandatory id, href). Query parameters are acceptable with any operation.



    ------------------------------
    Vance Shipley
    SigScale
    ------------------------------



  • 3.  RE: TMF630 - PATCH resource avoiding full object response

    TM Forum Member
    Posted 17 days ago

    Awesome! thank you so much Vance.



    ------------------------------
    Miguel Santasmarinas
    Vodafone Group
    ------------------------------