# pydantic_core._pydantic_core.ValidationError: 2 validation errors for User
foo
  Extra inputs are not permitted [type=extra_forbidden, input_value='bar', input_type=str]

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

## Root Cause

model_config has extra='forbid'. The incoming dict contains keys not declared on the model.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   class User(BaseModel):
    model_config = ConfigDict(extra='forbid')
    foo: str | None = None
   ```
2. **** (85% success)
   ```
   class User(BaseModel):
    model_config = ConfigDict(extra='allow')
   ```

## Dead Ends

- **** — Silently drops fields users expect to be persisted, causing data loss bugs. (55% fail)
- **** — Hides schema drift; clients keep sending wrong fields and you never notice. (50% fail)
- **** — Pydantic v2 does not accept **kwargs in BaseModel subclasses; raises PydanticUserError. (70% fail)
