# pydantic 2.14.2 (MIT), harvested by tools/harvest_corpus.py
=== input
Applies the discriminator and returns a new core schema.

    Args:
        schema: The input schema.
        discriminator: The name of the field which will serve as the discriminator.
        definitions: A mapping of schema ref to schema.

    Returns:
        The new core schema.

    Raises:
        TypeError:
            - If `discriminator` is used with invalid union variant.
            - If `discriminator` is used with union type with one variant.
            - If `discriminator` value mapped to multiple choices.
        MissingDefinitionForUnionRef:
            If the definition for ref is missing.
        PydanticUserError:
            - If a model in union doesn't have a discriminator field.
            - If discriminator field has a non-string alias.
            - If discriminator fields have different aliases.
            - If discriminator field not of type `Literal`.
    
=== parse google
short_description: 'Applies the discriminator and returns a new core schema.'
blank_after_short_description: True
blank_after_long_description: False
style: google
- DocstringParam
  description: 'The input schema.'
  kind: param
  key: 'param'
  arg_name: 'schema'
  is_optional: False
- DocstringParam
  description: 'The name of the field which will serve as the discriminator.'
  kind: param
  key: 'param'
  arg_name: 'discriminator'
  is_optional: False
- DocstringParam
  description: 'A mapping of schema ref to schema.'
  kind: param
  key: 'param'
  arg_name: 'definitions'
  is_optional: False
- DocstringReturns
  description: 'The new core schema.'
  kind: returns
  key: 'returns'
  is_generator: False
- DocstringRaises
  description: |
    - If `discriminator` is used with invalid union variant.
    - If `discriminator` is used with union type with one variant.
    - If `discriminator` value mapped to multiple choices.
  kind: raises
  key: 'raises'
  type_name: 'TypeError'
- DocstringRaises
  description: 'If the definition for ref is missing.'
  kind: raises
  key: 'raises'
  type_name: 'MissingDefinitionForUnionRef'
- DocstringRaises
  description: |
    - If a model in union doesn't have a discriminator field.
    - If discriminator field has a non-string alias.
    - If discriminator fields have different aliases.
    - If discriminator field not of type `Literal`.
  kind: raises
  key: 'raises'
  type_name: 'PydanticUserError'
=== detect
google
=== compose google
Applies the discriminator and returns a new core schema.

Args:
    schema: The input schema.
    discriminator: The name of the field which will serve as the discriminator.
    definitions: A mapping of schema ref to schema.

Returns:
    The new core schema.

Raises:
    TypeError: - If `discriminator` is used with invalid union variant.
        - If `discriminator` is used with union type with one variant.
        - If `discriminator` value mapped to multiple choices.
    MissingDefinitionForUnionRef: If the definition for ref is missing.
    PydanticUserError: - If a model in union doesn't have a discriminator field.
        - If discriminator field has a non-string alias.
        - If discriminator fields have different aliases.
        - If discriminator field not of type `Literal`.
