TM Forum Community

 View Only
  • 1.  TMF API Extension/Customization

    TM Forum Member
    Posted Jul 27, 2023 04:04

    Hi Team,

    Can you please suggest about below TMF API customization/extension approach correct or not?

    @Jonathan Goldberg Apologize to tag you specific, IF I can get clarification soon then it will be very helpful to me. 

    For Example : TMF622 : Product Order Management API

    Default Object in TMF API :

    "productSpecification": {
              "id": "string",
              "href": "string",
              "name": "string",
              "version": "string",
              "targetProductSchema": {
                "@baseType": "string",
                "@schemaLocation": "string",
                "@type": "string"
              },
              "@baseType": "string",
              "@schemaLocation": "string",
              "@type": "string",
              "@referredType": "string"
            },

    Customization/Extended Approach :

    "productSpecification": {
              "id": "string",
              "href": "string",
              "name": "string",
              "version": "string",
              "targetProductSchema": {
                "@baseType": "string",
                "@schemaLocation": "string",
                "@type": "string"
              },
              "productSpecCharacteristicValue": {
                "isDefault": true,
                "rangeInterval": "string",
                "unitOfMeasure": "string",
                "valueFrom": 0,
                "valueTo": 0,
                "valueType": "string",
                "validFor": {
                  "endDateTime": "2023-07-27T07:58:37.859Z",
                  "startDateTime": "2023-07-27T07:58:37.859Z"
                },
                "value": "string",
                "@baseType": "string",
                "@schemaLocation": "string",
                "@type": "string"
              },
              "@baseType": "string",
              "@schemaLocation": "string",
              "@type": "string",
              "@valueSchemaLocation": "string"
            }


    #General

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


  • 2.  RE: TMF API Extension/Customization

    TM Forum Member
    Posted Jul 28, 2023 02:11

    @Chetan Hirpara asks about the extension pattern (TMF730 Part 2).  Commenting only on the extension mechanism, and not the specific purpose of your extension:

    You are describing an extension to the ProductSpecificationRef schema.  An instance value should then include these attributes:

    "@type": "MyProductSpecificationRef",
    "@baseType": "ProductSpecificationRef",
    "@schemaLocation": "/path/to/my/schema/MyProductSpecificationRef.schema.json".

    You need to write the JSON Schema which defines your extension:

    {
      "$schema": "http://json-schema.org/draft-07/schema#",
      "$id": "MyProductSpecificationRef.schema.json",
      "title": "MyProductSpecificationRef",
      "definitions": {
        "MyProductSpecificationRef": {
          "$id": "#MyProductSpecificationRef",
          "description": "My Product specification reference extension.",
          "type": "object",
          "properties": {
                "myProperty": {
                      ...
                }
            }
          },
          "allOf": [
            {
              "$ref": "Product/ProductSpecificationRef.schema.json#ProductSpecificationRef"
            }
          ]
        }
      }
    }


    ------------------------------
    Vance Shipley
    SigScale
    ------------------------------