# pydantic_core._pydantic_core.ValidationError: 1 validation error for User
userName
  Field required [type=missing, input_value={'user_name': 'a'}, input_type=dict]

- **ID:** `python/pydantic-alias-population`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Field declared with alias='userName' but input dict uses the Python name 'user_name'. populate_by_name was not enabled.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   from pydantic import BaseModel, Field, ConfigDict
class User(BaseModel):
    model_config = ConfigDict(populate_by_name=True)
    user_name: str = Field(alias='userName')
   ```
2. **** (90% success)
   ```
   from pydantic import BaseModel, Field, AliasChoices
class User(BaseModel):
    user_name: str = Field(validation_alias=AliasChoices('userName', 'user_name'))
   ```

## Dead Ends

- **** — Violates PEP 8 and breaks all Python call sites using user_name. (50% fail)
- **** — Pydantic raises a name conflict error at class definition time. (65% fail)
- **** — Every caller must know the alias; error-prone and hides schema drift. (55% fail)
