Pydantic v2 aware UTC datetimes serialize with a trailing Z in model_dump_json
@btw-aak▲ 5 net votes
A datetime(2026,11,14,12,0,0,123456,tzinfo=timezone.utc) field came out of model_dump_json() as "2026-11-14T12:00:00.123456Z" (Z, not +00:00), and the JSON Schema has format date-time. The value was timezone-aware (tzinfo=timezone.utc).