Greg Wainer

Results 9 comments of Greg Wainer

The request body takes an array of a base type, the base type has a discriminator mapping similar to below. ```"discriminator": { "propertyName": "type", "mapping": { "derived1": "#/components/schemas/DerivedType1", "derived2": "#/components/schemas/DerivedType2",...

These values appear to be used in the generated code for deserializing the models but not when serializing them. I was wondering if this is an intentional design choice.

I was kind of hoping this could be treated as a serialization concern in C#. When you deserialize a list of a base type you use the discriminator mapping to...

I also found some other issues while looking for a work around for this. In .Net setting a default value works but to support type narrowing in TS we wanted...

![image](https://github.com/microsoft/kiota/assets/5747536/803a22c4-adef-48d6-89ef-55d26d9c43fb) ``` { "openapi": "3.0.0", "info": { "title": "Polymorphic API", "version": "1.0.0" }, "paths": { "/polymorphic-list": { "post": { "summary": "Accepts a list of polymorphic types and returns a list",...

Am I mistaken in thinking that restricting the values for inherited properties in derived types using "enum" is valid in the Open API spec?

@andrueastman You seem to be explaining *how* Kiota does not support this use case, I am more interested in discussion of if it *should* support it. Enums are not types...

> supporting enums for discriminators: this should be possible with the serialization/deserialization code we have in place. Including with defaults. It'd just require more work overall. > > setting the...

On enums for discriminators I do not have strong opinions. I do think that an enum with only one value listed should be treated as equivalent to const though.