microsoft / microsoft/typespec

Support discriminator where discriminated value is a union

Open
#6,307 0 comments 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.