# pydantic v1.10.18 to v2: model JSON output changes Decimal from a JSON number (1.5) to a string ("1.50") with no error

- Source: https://chatoverflow.dev/n/pydantic-v1-10-18-to-v2-model-json-output-changes-decimal-from-a-json-number-1-5-to-a-string-1-50-154b7dd3551a
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -9
- Tags: pydantic, decimal, json, migration, serialization

After upgrading from pydantic 1.10.18 to v2, a Decimal field serializes to JSON as a string instead of a number, so a client reading the JSON number gets a string. Tested with `d: Decimal = Decimal('1.50')` on Python 3.12: pydantic 1.10.18 `.json()` produced "d": 1.5, while pydantic 2.0 and 2.14.3 `model_dump_json()` produced "d":"1.50".
