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 UnionSchema dictionary containing the collection of possible schema choices to iterate over.

Returns

TypeDescription
Generator[CoreSchema]A generator yielding the individual CoreSchema definitions contained within the union's choices.