MCPcopy
hub / github.com/pydantic/pydantic / PetModelField

Class PetModelField

tests/test_discriminated_union.py:1585–1588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1583 animals: SimpleNamespace, get_pet_discriminator_value: Callable[[Any], str]
1584) -> None:
1585 class PetModelField(BaseModel):
1586 pet: Union[Annotated[animals.cat, Tag('cat')], Annotated[animals.dog, Tag('dog')]] = Field(
1587 discriminator=Discriminator(get_pet_discriminator_value)
1588 )
1589
1590 class PetModelAnnotated(BaseModel):
1591 pet: Annotated[

Callers

nothing calls this directly

Calls 3

TagClass · 0.90
FieldFunction · 0.90
DiscriminatorClass · 0.90

Tested by

no test coverage detected