# pydantic_core._pydantic_core.PydanticSerializationError: Unable to serialize unknown type: <class 'datetime.date'>

- **ID:** `python/pydantic-model-dump-json-not-serializable`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

model_dump_json or model_dump(mode='json') encountered a type with no registered serializer, often a custom class or a third-party object stored in an Any field.

## Version Compatibility

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

## Workarounds

1. **** (93% success)
   ```
   from datetime import date
from pydantic import BaseModel, field_serializer

class Model(BaseModel):
    d: date

    @field_serializer('d')
    def ser_date(self, v: date, _info):
        return v.isoformat()
   ```
2. **** (90% success)
   ```
   from typing import Annotated
from pydantic import PlainSerializer

IsoDate = Annotated[date, PlainSerializer(lambda v: v.isoformat(), return_type=str)]
   ```

## Dead Ends

- **** — model_dump() returns Python objects, so json.dumps fails with the same underlying non-serializable type error. (80% fail)
- **** — Changes validation semantics and loses type information for all consumers, not just serialization. (60% fail)
