Open APIs

 View Only
Expand all | Collapse all

TMF 680 : Status code mismatch POST /queryProductRecommendation in example specification and Swagger

  • 1.  TMF 680 : Status code mismatch POST /queryProductRecommendation in example specification and Swagger

    Posted Jun 12, 2023 05:47

    When going through the specification for TMF 680 (POST /queryProductRecommendation), i found status code 202 in the given example. However in Swagger there is no status code 202, rather 201, 400, 401 etc. are available.

    Is there a typo in swagger file ? Also the if it is really 201, that means there is a catalog of recommendation of resources at design time. 



    ------------------------------
    Rosalin Panda
    Telia Company
    ------------------------------


  • 2.  RE: TMF 680 : Status code mismatch POST /queryProductRecommendation in example specification and Swagger

    Posted Jun 13, 2023 15:30

    Tricky one, this. All Open API swaggers are generated, and the tooling "decides" which return codes to generate. In v4 we don't have much control over that, in v5 the situation is a lot better.

    For a task resource like this one (product recommendation), we can imagine valid use cases:

    • 200 - recommendation is returned synchronously, no persistence
    • 201 - recommendation is returned synchronously or asynchronously, and is persisted for future retrieval
    • 202 - recommendation is returned asynchronously (hence the Accepted code).

    It's up to you as an API implementor to decide which pattern(s) to support for your task resources. 



    ------------------------------
    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.
    ------------------------------