-
Notifications
You must be signed in to change notification settings - Fork 65
Description
Currently, all models are generated by with a default value for the @odata.type property which is further propagated into generated models in Kiota. This shouldn't be an issue per se but various workloads seem to not support the existence of this property as seen in the numerous linked issues to microsoftgraph/MSGraph-SDK-Code-Generator#534 (comment).
The proposal therefore is to have the @odata.type not set by default in the result openApi generation and have it set in the following conditions where type disambiguation is necessary as the API will need to know the type to infer and take advantage of the properties.
- The type derives from an abstract type
- One of its base/parent types is referenced as the type for a property in another type (except if the base is entity).
- One of its base types is referenced as the type in an odata action in another type (except if the base is entity).
Possibly, the default behaviour could have the @odata.type property set/unset and then we would add a setting to enable this behaiour as this may not really be a valid ask for another odata API needing the conversion to be performed.
Related issues