# pydantic.errors.PydanticUserError: `Config` and `fields` are deprecated in Pydantic V2. Use `model_config` and `Field` instead. See https://docs.pydantic.dev/2.0/migration/

- **ID:** `python/pydantic-config-and-fields-deprecated`
- **Domain:** python
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

A v1-style inner class Config or fields dict was used in a model under Pydantic v2.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   from pydantic import BaseModel, ConfigDict
class M(BaseModel):
    model_config = ConfigDict(orm_mode=True)  # was class Config: orm_mode = True
    x: int
   ```
2. **** (85% success)
   ```
   pip install bump-pydantic
bump-pydantic ./src
   ```

## Dead Ends

- **** — No such switch exists; pydantic 2.x always rejects v1 config. (80% fail)
- **** — Blocks upgrades of FastAPI and other deps that require v2. (60% fail)
- **** — The error is raised at class definition time, not import time, and cannot be caught usefully. (70% fail)
