Open APIs

Expand all | Collapse all

Data Model For Error Schema

  • 1.  Data Model For Error Schema

    TM Forum Member
    Posted Jan 26, 2021 23:02

    Hi there , 

    Looking for  clarification  related to the Error schema . 

    As per the  Error Schema ,   Error. code  is of type integer . 

     But in example ,  it is  shown as string .
    In 630 Part 1 Guideline also , the example has the code as string 

     

    Please  confirm what should be the right type for Error.code.

     cc: @Rati Mehrotra

    ​​Thanks & Regards,

    ------------------------------
    Uma Lakshman
    Telstra Corporation
    ------------------------------


  • 2.  RE: Data Model For Error Schema

    TM Forum Member
    Posted Jan 27, 2021 04:42
    Hi Uma

    The correct type for Error.code is indeed string, and that's how it is generated into all the swagger files.
    But your confusion is understandable. For historical reasons, the Error.schema.json file is not used when Open API swaggers are generated. Instead the Error definition in the swagger is constructed from strings embedded within the tooling.
    I hope that this will be corrected going forward in a new version of the tooling. In the meantime I am correcting the Error schema so that it matches what is actually generated.

    Thanks for calling this problem out.

    ------------------------------
    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: Data Model For Error Schema

    TM Forum Member
    Posted 30 days ago

    Thanks @Jonathan Goldberg

    @Ludovic Robert, @Kamal Maghsoudlou,
      the serviceOrder.errorMessage.code and serviceOrder. serviceOrderItem.errorMessage.code are currently modelled as integer in 641 V4.1

    While we discussed the 641 errorMessage modelling in API call, understanding was that it will be an extension of existing error schema . Based on the latest update from Jonathan, will it result in an update to 641 errorMessage as well?

    ​​​​​
    cc: @Rati Mehrotra

    ------------------------------
    Uma Lakshman
    Telstra Corporation
    ------------------------------



  • 4.  RE: Data Model For Error Schema

    TM Forum Member
    Posted 9 days ago
    Hi,
    The Error.code, as Jonathan mentioned, is managed by tooling and not by schema. The 'errorMessage.code' in the schema is defined as integer to align with http response status code which is a three-digit integer as per RFC7231. However, the 'errorMessage.status' can be used as extended code as string.
    Regards,
    Kamal

    ------------------------------
    Kamal Maghsoudlou
    Ericsson Inc.
    ------------------------------



  • 5.  RE: Data Model For Error Schema

    TM Forum Member
    Posted 2 days ago
    NB: Jonathon wrote "The correct type for Error.code is indeed string".
    My reading is the error code in the payload is independent of the HTTP status code.
    (the semantics should be aligned of course - e.g. I would not expect payload error code = Success and HTTP code = 400).

    ------------------------------
    Alasdair MacLeod
    BT Group plc
    ------------------------------