# pydantic_core._pydantic_core.ValidationError: 3 validation errors for TaggedUnion
cat.kind
  Input should be 'cat' [type=literal_error, input_value='dog', input_type=str]

- **ID:** `python/pydantic-union-tag-discriminator-error`
- **Domain:** python
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A discriminated union with a Literal discriminator received a tag value that does not match any union member, so every branch fails validation.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 2.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   kind = data.get('kind')
mapping = {'cat': Cat, 'dog': Dog}
if kind not in mapping:
    raise ValueError(f'unknown kind: {kind}')
obj = mapping[kind].model_validate(data)
   ```
2. **** (85% success)
   ```
   from typing import Annotated
from pydantic import BeforeValidator

Normalize = Annotated[str, BeforeValidator(lambda v: v.lower())]

class Cat(BaseModel):
    kind: Literal['cat']
    name: Normalize
   ```

## Dead Ends

- **** — Falls back to slow smart-union matching and produces confusing errors when multiple members overlap. (65% fail)
- **** — Discriminator requires all Literal values to be unique; a str member makes the union ambiguous and Pydantic raises at build time. (80% fail)
