Azure / autorest.csharp

Extension for AutoRest (https://github.com/Azure/autorest) that generates C# code
MIT License
143 stars 166 forks source link

Generator cannot handle it properly when a schema has both `x-ms-client-flatten` and a discriminator #4036

Open ArcturusZhang opened 11 months ago

ArcturusZhang commented 11 months ago

When a property has x-ms-client-flatten: true extension, and its schema has a discriminator, our generator is only generating the model with properties flattened from the base model of the discriminated set. All derived types from the set have been omitted and the user of the library cannot use any property from the derived types.

Example and fix: https://github.com/Azure/azure-sdk-for-net/pull/40683 Theoretically this could happen to any swagger, and to typespec if typespec supports the same functionality.

ArthurMa1978 commented 2 weeks ago

Will be a item for Azure plugin for MGC