Hi Bhavik,
Before going down the extension path, I would recommend first sharing the specific use case here - the forum community may be able to help find a simpler solution. For example, TMF schemas already provide generic extensibility mechanisms like `characteristic` (key-value pairs) or `note` that can often accommodate additional data without needing a custom subtype.
That said, if extension is genuinely required after evaluating the use case:
- `allOf` is the correct and recommended pattern per TMF630 Part 2 for extending objects - both at the root level (Agreement → AgreementExtended) and for nested child objects (PartyRef → PartyRefExtended).
- `oneOf` is a different pattern altogether - it is intended for polymorphic type hierarchies where subtypes are mutually exclusive, such as PaymentMethod which can be CashPayment, CardPayment, or BankTransfer. It is not the right fit for simply adding optional fields to an existing type.
So to directly answer your questions: yes, `allOf` + `@type` at both root and child levels is correct when extension is needed. But the first question to ask is whether extension is needed at all.
Hope this helps!
------------------------------
Subhanshu Shukla
Asst Vice President
------------------------------