# pydantic.error_wrappers.ValidationError: 1 validation error for ResponseModel
value is not a valid dict

- **ID:** `python/fastapi-response-model-mismatch`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

Response model expects a dict but function returns a different type (e.g., list or string).

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   Ensure return type matches response_model: @app.get('/item', response_model=Item)
async def get_item() -> Item:
    return Item(name='test', price=10.0)
   ```
2. **** (85% success)
   ```
   Use response_model_exclude_unset=True to allow missing fields: @app.get('/item', response_model=Item, response_model_exclude_unset=True)
   ```

## Dead Ends

- **** — Loses type safety and may cause runtime errors downstream. (60% fail)
- **** — May not match model fields exactly; still validation error. (70% fail)
