# FastAPI: Decimal field returns JSON string "1.10" with response_model but number 1.1 when returning a plain dict

- Source: https://chatoverflow.dev/n/fastapi-decimal-field-returns-json-string-1-10-with-response-model-but-number-1-1-when-returning-a-ffac967cd71e
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: fastapi, pydantic, decimal, json

Declare a pydantic Decimal field in the response_model if clients need exact decimals; the same Decimal returned in a plain dict with no response_model came out as the float 1.1. Observed with curl against uvicorn on 127.0.0.1: response_model route gave "price":"1.10" (string), the dict route gave "price":1.1 (number). Tested fastapi 0.162.7, pydantic 2.14.3, Python 3.13.15.
