Skip to content

[ Pydantic V2 ](https://docs.pydantic.dev/2.0/blog/pydantic-v2-final/) is here
🚀! Upgrading an existing app? See the [ Migration Guide
](https://docs.pydantic.dev/2.0/migration/) for tips on essential changes from
Pydantic V1!

[ ![logo](../../logo-white.svg) ](../.. "Pydantic")

Pydantic

Unions

Initializing search

[ pydantic/pydantic  ](https://github.com/pydantic/pydantic "Go to
repository")

  * [ Get Started ](../..)
  * [ Concepts ](../models/)
  * [ API Documentation ](../../api/base_model/)
  * [ Examples ](../../examples/secrets/)
  * [ Error Messages ](../../errors/errors/)
  * [ Integrations ](../../integrations/mypy/)
  * [ Blog ](https://blog.pydantic.dev/)
  * [ Pydantic People ](../../pydantic_people/)

[ ![logo](../../logo-white.svg) ](../.. "Pydantic") Pydantic

[ pydantic/pydantic  ](https://github.com/pydantic/pydantic "Go to
repository")

  * Get Started  Get Started 
    * [ Welcome to Pydantic  ](../..)
    * [ Why use Pydantic  ](../../why/)
    * [ Help with Pydantic  ](../../help_with_pydantic/)
    * [ Installation  ](../../install/)
    * [ Migration Guide  ](../../migration/)
    * [ Version Policy  ](../../version-policy/)
    * [ Contributing  ](../../contributing/)
    * [ Changelog  ](../../changelog/)
  * Concepts  Concepts 
    * [ Models  ](../models/)
    * [ Fields  ](../fields/)
    * [ JSON Schema  ](../json_schema/)
    * [ JSON  ](../json/)
    * [ Types  ](../types/)
    * Unions  [ Unions  ](./) Page contents 
      * Union Modes 
        * Left to Right Mode 
        * Smart Mode 
      * Discriminated Unions 
        * Discriminated Unions with str discriminators 
        * Discriminated Unions with callable Discriminator 
        * Nested Discriminated Unions 
      * Union Validation Errors 
    * [ Alias  ](../alias/)
    * [ Configuration  ](../config/)
    * [ Serialization  ](../serialization/)
    * [ Validators  ](../validators/)
    * [ Dataclasses  ](../dataclasses/)
    * [ Postponed Annotations  ](../postponed_annotations/)
    * [ Strict Mode  ](../strict_mode/)
    * [ Type Adapter  ](../type_adapter/)
    * [ Validation Decorator  ](../validation_decorator/)
    * [ Conversion Table  ](../conversion_table/)
    * [ Settings Management  ](../pydantic_settings/)
    * [ Performance  ](../performance/)
    * [ Pydantic Plugins  ](../plugins/)
  * API Documentation  API Documentation 
    * Pydantic  Pydantic 
      * [ BaseModel  ](../../api/base_model/)
      * [ RootModel  ](../../api/root_model/)
      * [ Pydantic Dataclasses  ](../../api/dataclasses/)
      * [ TypeAdapter  ](../../api/type_adapter/)
      * [ Validate Call  ](../../api/validate_call/)
      * [ Fields  ](../../api/fields/)
      * [ Aliases  ](../../api/aliases/)
      * [ Configuration  ](../../api/config/)
      * [ JSON Schema  ](../../api/json_schema/)
      * [ Errors  ](../../api/errors/)
      * [ Functional Validators  ](../../api/functional_validators/)
      * [ Functional Serializers  ](../../api/functional_serializers/)
      * [ Standard Library Types  ](../../api/standard_library_types/)
      * [ Pydantic Types  ](../../api/types/)
      * [ Network Types  ](../../api/networks/)
      * [ Version Information  ](../../api/version/)
      * [ Pydantic Plugins  ](../../api/plugin/)
      * [ Annotated Handlers  ](../../api/annotated_handlers/)
    * Pydantic Core  Pydantic Core 
      * [ pydantic_core  ](../../api/pydantic_core/)
      * [ pydantic_core.core_schema  ](../../api/pydantic_core_schema/)
    * [ Pydantic Settings  ](../../api/pydantic_settings/)
    * Pydantic Extra Types  Pydantic Extra Types 
      * [ Color  ](../../api/pydantic_extra_types_color/)
      * [ Country  ](../../api/pydantic_extra_types_country/)
      * [ Payment  ](../../api/pydantic_extra_types_payment/)
      * [ Phone Numbers  ](../../api/pydantic_extra_types_phone_numbers/)
      * [ Routing Numbers  ](../../api/pydantic_extra_types_routing_numbers/)
      * [ Coordinate  ](../../ap