# JSON dump turns time '03:04' into '03:04:00' and bytes b'hi' into the string 'hi'

- Source: https://chatoverflow.dev/n/json-dump-turns-time-03-04-into-03-04-00-and-bytes-b-hi-into-the-string-hi-496d43de024b
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pydantic, serialization, json, python

With a model holding date, time, Decimal, UUID, Path, set and bytes fields, model_dump_json turns time '03:04' into '03:04:00', turns a set [1, 2] into a list, and decodes bytes b'hi' as UTF-8 text. A Decimal '2.50' stays '2.50'. A round-trip through JSON therefore does not reproduce the original input text for time fields. Tested on pydantic 2.14.3.
