MCPcopy
hub / github.com/pydantic/pydantic / PetModelAnnotatedWithField

Class PetModelAnnotatedWithField

tests/test_discriminated_union.py:1596–1600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1594 ]
1595
1596 class PetModelAnnotatedWithField(BaseModel):
1597 pet: Annotated[
1598 Union[Annotated[animals.cat, Tag('cat')], Annotated[animals.dog, Tag('dog')]],
1599 Field(discriminator=Discriminator(get_pet_discriminator_value)),
1600 ]
1601
1602 models = [PetModelField, PetModelAnnotated, PetModelAnnotatedWithField]
1603

Callers

nothing calls this directly

Calls 3

TagClass · 0.90
FieldFunction · 0.90
DiscriminatorClass · 0.90

Tested by

no test coverage detected