Skip to main content

iter_union_choices

Iterate over the choices of a 'union' schema.

def iter_union_choices(
union_schema: UnionSchema
) - > Generator[CoreSchema]

Iterate over the choices of a 'union' schema.

Parameters

NameTypeDescription
union_schemaUnionSchemaThe Pydantic core schema representing a union type from which to extract member choices.

Returns

TypeDescription
Generator[CoreSchema]A generator yielding the individual CoreSchema definitions contained within the union, resolving any tuple-wrapped choices.