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

Types

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  ](./) Page contents 
      * Type conversion 
      * Strict Types 
        * Constrained types 
      * Custom Types 
        * Composing types via Annotated 
          * Adding validation and serialization 
          * Generics 
        * Named type aliases 
          * Named recursive types 
        * Customizing validation with __get_pydantic_core_schema__ 
          * As a method on a custom type 
          * As an annotation 
          * Handling third-party types 
          * Using GetPydanticSchema to reduce boilerplate 
          * Summary 
        * Handling custom generic classes 
          * Generic containers 
        * Access to field name 
    * [ Unions  ](../unions/)
    * [ 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