Skip to content

Support discriminator where discriminated value is a union #6307

Open
@JoshLove-msft

Description

@JoshLove-msft

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    emitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharplib:http-specsFor issues/prs related to the @typespec/http-specs package

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions