Hi Ashish
I refer you to Part 2 of the Open API design guidelines TMF630 (https://projects.tmforum.org/wiki/display/PUB/TMF630+REST+API+Design+Guidelines+v4.2.0)
Let's suppose that (as in your example) you are extending the Account entity and schema to create an AccountExtension class.
In your payloads for AccountExtension
* @type would the string "AccountExtension"
* @baseType would be the string "Account"
* @schemaLocation would be a URL that logically describes your extension, for instance it could point to a yaml or json schema file with property definitions for "Customattribute1" and "Customattribute2" together with an allOf for the base Account schema.
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.
------------------------------
Original Message:
Sent: May 19, 2023 08:33
From: Ashish Sharma
Subject: Extending the schema
I have a basic query, if i need to extend my structure with custom attributes, should i use "schema location" or i can directly attach a substructure.
Also do i need to define a @type with schema location always?
For example do i have to use "Schemalocation" array name in JSON structure or can use a name as "AccountExtension"
"id": "string",
"accountType": "string",
"description": "string",
"LastName": null,
"state": "string",
"@schemaLocation":
{"Customattribute1": "string",
"Customattribute2": "string",
------------------------------
Ashish Sharma
Bharti Airtel Ltd
------------------------------