Populate the discriminator property for derrived types.
- Dominant language
- C#
- Stars
- 3.8k
- Forks
- 333
- Avg merge
- 16h 29m
- Merged PRs (30d)
- 116
Description
### Is your feature request related to a problem? Please describe the problem.
I could be doing something wrong here but I couldn't find any documentation on sending heterogeneous collections in a post, only on receiving them. I have an endpoint that takes a list of derived types, the open API spec defines the discriminator property and the mappings for the derived types. The models for the derived types that Kiota generates have a Type property I can assign the correct value to but by default it is empty.
### Client library/SDK language
Csharp
### Describe the solution you'd like
Since the desired value for these types is constant and defined in the open API spec I don't understand why I need to set it when working with these models. Can it not just be hard coded to the correct value?
### Additional context
It's possible there is something wrong with my open API spec but I couldn't find any confirmation in the documentation of what the desired behavior is for this use case is.
Contributor guide
Research direction
Start by reproducing the issue with an OpenAPI spec that defines discriminator mappings and a heterogeneous collection, then inspect the generated C# models and their Type property. Compare the generated derived types with the discriminator values in the spec; done means those values are populated without manual assignment and are serialized correctly for POST requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, openapi
- Domain
- api, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100