# TypeError: Object of type datetime is not JSON serializable

- **ID:** `python/flask-jsonify-serialization`
- **Domain:** python
- **Category:** type_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

jsonify() cannot serialize non-JSON-native types such as datetime, Decimal, or custom objects.

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   return jsonify({'created': obj.created_at.isoformat()})
   ```
2. **** (88% success)
   ```
   from flask.json.provider import DefaultJSONProvider
class P(DefaultJSONProvider):
    @staticmethod
    def default(o): return o.isoformat()
app.json = P(app)
   ```

## Dead Ends

- **** — Bypasses Flask's jsonify behavior and content-type handling. (60% fail)
- **** — Hides the real serialization issue from clients. (80% fail)
