TMF630 Part 2 says allOf should be used to extend objects, and base collection operations can create/return concrete subtypes using @type. And hence if we need to add new optional fields to the standard TMF object, it has to be extended.
Using TMF630 extension pattern (allOf + @type), if I extend Agreement to AgreementExtended and also extend nested child objects such as PartyRef to PartyRefExtended ,what is the recommended request/response pattern?
Example:
- root payload has
@type = AgreementExtended
- child payload needs to have
@type = PartyRefExtended
Questions:
-
Is this the recommended TMF modeling pattern for extending both root and child objects?
- Should request/response schemas still reference the base object and rely on runtime
@type?
- Or should endpoint schemas explicitly expose base + extended variants using oneOf at endoint level?
- For nested objects, should the child return its extended
@type when extra fields are present?
Would appreciate any examples from TMF APIs or implementation guidance.
#General------------------------------
Bhavik Parekh
Infosys
------------------------------