# pydantic.errors.ConfigError: 'extra' must be a string or dict

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

## Root Cause

In Pydantic v2, the 'extra' config option only accepts specific string values ('allow', 'ignore', 'forbid') or a dict, not a boolean or arbitrary string.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Set extra='forbid' or 'allow' in model config: class Model(BaseModel): model_config = ConfigDict(extra='forbid')
   ```
2. **** (85% success)
   ```
   Use a dict to customize extra fields: model_config = ConfigDict(extra={'field': 'value'})
   ```

## Dead Ends

- **** — Boolean values are not valid for 'extra' in v2; it requires string or dict, leading to ConfigError. (80% fail)
- **** — 'extra' does not accept a list; it must be a string or dict, so this raises ConfigError. (70% fail)
