Open APIs

Expand all | Collapse all

Using @type in json response

  • 1.  Using @type in json response

    TM Forum Member
    Posted Aug 31, 2020 14:35
    Hi
    @ type is used in the Specs, and also in the json examples given in TMF Specs.​
    But is it supposed to be used in actual Server side API implementations? or we should interpret it as type and accordingly populate the response?

    { "@type": "Customer", "href": "https://host:port/tmf-api/customerManagement/v4/customer/1140", "id": "1140", "name": "Moon Football Club", "status": "Approved"}

    Thanks


    ------------------------------
    Adity Mukherjee
    CSG International
    ------------------------------


  • 2.  RE: Using @type in json response

    TM Forum Member
    Posted Sep 06, 2020 07:01
    Hi Adity
    Please refer to the design guidelines TMF630 (here) for a full explanation of the @ fields.
    The idea of the @type​​ field is to indicate the data/entity type of the entity, it is not intended to convey an applicative type (e.g. for customer, an applicative type might be residential, business, government, etc.). Thus if you had (for instance) extended Customer to add a value attribute, thus creating (say) CSGCustomer, you would populate @type with "CSGCustomer" and @baseType with "Customer".​​
    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.
    ------------------------------