Open APIs

 View Only
  • 1.  Geographic Address in TMF 622 ProductOrdering Open API

    TM Forum Member
    Posted Dec 30, 2023 00:00
      |   view attached

    Hi all,

    We could see GeographicAddress resource model depicted in TMF 622 ProductOrdering Open API User Guide (Snapshot below). But, couldn't find any reference to the same in context of ProductOrdering core resource models like ProductOrder, ProductOrderItem, Product etc.

    Could you please help with the relevance of putting GeographicAddress resource model in TMF 622 ProductOrdering API user guide?



    ------------------------------
    Varun Pandhi
    Infosys
    ------------------------------


  • 2.  RE: Geographic Address in TMF 622 ProductOrdering Open API

    TM Forum Member
    Posted Dec 31, 2023 04:06

    Hi Varun

    References to address and so forth in the Open API model are generally done by Place or RelatedPlace. The intention is that the referred entity will be a GeographicAddress, Location, or Site. These Geo entities are all subclasses of Place.

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



  • 3.  RE: Geographic Address in TMF 622 ProductOrdering Open API

    TM Forum Member
    Posted Jan 08, 2024 05:23

    Hi @Jonathan Goldberg

    We understood that Geo entities are all subclasses of Place but we are getting limited attributes under place object during product order execution so where are we capturing all other attributes that are available under GeographicAddress and GeographicSubAddress?



    ------------------------------
    Chetan Patel
    Tech Mahindra Limited
    ------------------------------



  • 4.  RE: Geographic Address in TMF 622 ProductOrdering Open API

    TM Forum Member
    Posted Jan 09, 2024 01:32

    Hi Chetan

    This is a general challenge when using base class representations in Swagger. We don't have a good way of including the subclass definitions into the swagger file.

    In v5 APIs, where we have moved to support Swagger (OAS) 3, and we have the oneOf syntax available, we can do something like this, explicitly including all the subclasses. You can see about 20 published v5 APIs at https://www.tmforum.org/oda/open-apis/table - I don't recall off-hand if any of these APIs use PlaceRefOrValue, but if they do you will find this construct in the swagger file

    {
        "$schema": "http://json-schema.org/draft-07/schema#",
        "$id": "PlaceRefOrValue.schema.json",
        "title": "PlaceRefOrValue",
        "definitions": {
            "PlaceRefOrValue": {
                "$id": "#PlaceRefOrValue",
                "description": "The polymorphic attributes @type, @schemaLocation & @referredType are related to the Place entity and not the PlaceRefOrValue class itself",
                "type": "object",
                "oneOf": [
                    {
                        "$ref": "GeographicLocation.schema.json#/definitions/GeographicLocation"
                    },
                    {
                        "$ref": "GeographicSite.schema.json#/definitions/GeographicSite"
                    },
                    {
                        "$ref": "GeographicAddress.schema.json#/definitions/GeographicAddress"
                    },
                    {
                        "$ref": "PlaceRef.schema.json#/definitions/PlaceRef"
                    }
                ]
            }
        }
    }



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