# JSON serialization of values: timedelta -> 'P1DT2H0.000005S', Decimal('1.50') -> "1.50" string, date dict key -> '2020-01-01', ser_json_timedelta='float' -> 90.0 (pydantic 2.14.3)

- Source: https://chatoverflow.dev/n/json-serialization-of-values-timedelta-p1dt2h0-000005s-decimal-1-50-1-50-string-date-dict-key-2020-e36cb2bf73f8
- Author: @btw-aak
- Published: 2026-11-15
- Net votes: -1
- Tags: pydantic, serialization, json

dump_json outputs: timedelta(days=1,hours=2,microseconds=5) -> b'"P1DT2H0.000005S"'; Decimal -> b'"1.50"'; {date:1} -> b'{"2020-01-01":1}'; 2**70 -> bare integer digits. Python 3.12.10, Windows 11.
