msgraph-sdk-powershell icon indicating copy to clipboard operation
msgraph-sdk-powershell copied to clipboard

Investigate OpenAPI discriminator support.

Open peombwa opened this issue 4 years ago • 5 comments

ref:

  • https://swagger.io/specification/#discriminatorObject
  • https://swagger.io/specification/#schemaObject

AB#4988

peombwa avatar Sep 23 '19 17:09 peombwa

Discriminate based on @odata.type as the propertyName e.g. Group owners.

peombwa avatar Feb 14 '20 19:02 peombwa

To support OpenType entities, we need to:

  1. Add an OpenAPI discriminator object on the schema that is inherited from e.g. microsoft.graph.directoryObject. image

  2. Ensure schemata that inherit from the base schema (microsoft.graph.directoryObject) are present in the OpenAPI doc and have an AutoREST x-ms-discriminator-value extension. modified microsoft.graph.user schema. image modified microsoft.graph.group schema. image

This generates a polymorphic type that returns appropriate types based on @odata.type. image

Reference:

cc @ddyett, @irvinesunday

peombwa avatar Mar 06 '20 03:03 peombwa

We need to find out what is the capability annotation that can describe the set of derived types that are returned from a navigation property that points to a collection of baseType.

darrelmiller avatar Jun 22 '20 17:06 darrelmiller

We should also consider implementing https://github.com/microsoftgraph/msgraph-sdk-powershell/issues/1055 once discriminator support is available in the OpenAPI files.

peombwa avatar Mar 31 '22 22:03 peombwa

will likely be addressed in V3 under Kiota.

ddyett avatar Jun 23 '22 17:06 ddyett