microsoft / microsoft/typespec
Support discriminator where discriminated value is a union
Open
emitter:client:csharp
lib:http-specs
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
A model like this will cause errors when generating because the discriminator property can have multiple possible values. We should add support for this. We should also request a Spector scenario for it.
```
@discriminator("type")
model ResponsesInputContent extends ResponsesContent {
type:
| ResponsesContentType.input_text
| ResponsesContentType.input_audio
| ResponsesContentType.input_image
| ResponsesContentType.input_file;
}
```
Contributor guide
Assessment
This issue has not been assessed yet.