Please note - I forgot to mention that as a result of its use as a discriminator, @type is mandatory (i.e. a value must be populated) in all Open API entities in v5 APIs.
------------------------------
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: Jul 31, 2023 11:33
From: Martin Brassard
Subject: Question about inheritance decision
Thanks @Jonathan Goldberg, it helps a lot as we were afraid doing it on existing contracts would break something unexpectedly.
We'll move ahead with our cusotmization while waiting for v5 release.
------------------------------
Martin Brassard
IBM Corporation
Original Message:
Sent: Jul 30, 2023 03:10
From: Jonathan Goldberg
Subject: Question about inheritance decision
Hi Martin
In the Open APIs up to and including v4, we were using Swagger 2.x - and for various reasons (admittedly I'm not so familiar with the details) it wasn't feasible to make this part of the API definitions.
In v5 APIs (first batch of APIs soon to be released) we have upgraded to OAS 3.x , including extensive use of oneOf, and @type is used as a discriminator for inheritance.
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: Jul 28, 2023 10:13
From: Martin Brassard
Subject: Question about inheritance decision
Hello,
We are working with the TMF OpenAPI specification and we have some struggle when using a code generator with inheritance. Since the swagger does not specify the @type field as required, nor does specify a discriminator, we need to do some configuration to generate code using inheritance rather than combining the fields from the classes.
Is anyone aware of the rationale behind the decision of not using discriminator in the TMF entities?
------------------------------
Martin Brassard
IBM Corporation
------------------------------