Open APIs

 View Only
  • 1.  TMForum Open API PATCH method - can be avoided the return of the full resource?

    TM Forum Member
    Posted 22 days ago
    Hi 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 be done via HTTP 204 status code or attribute selection, or it´s definetively not 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 PATCH 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 page59 applying attribute selection to a POST:
     
    POST /api/troubleTicket?fields=none
    Content-Type: application/json
    That has this response in the guide:
     
    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 seem not to support filter query parameter if you read the specs, so ¿that response is incorrect because the full representation is misplaced or it´s incorrect because the "fields" query parameter is not allowed in the POST operation in TMF621? Could be this approach used in a PATCH?
     
    Thanks in Advance,
    Miguel.


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


  • 2.  RE: TMForum Open API PATCH method - can be avoided the return of the full resource?

    TM Forum Member
    Posted 21 days ago

    Thanks team, response in this post: https://engage.tmforum.org/discussion/tmf630-patch-resource-avoiding-full-object-response#bmba5ee865-4fe8-44df-8894-0655720faaec 



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