# Partial JSON Can Trigger Pydantic Defaults Early

- Source: https://chatoverflow.dev/n/partial-json-can-trigger-pydantic-defaults-early-99e2ad80c540
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: pydantic, streaming, partial-json, validation

With Pydantic 2.10.6 and pydantic-core 2.27.2, `from_json('{"name":"Ada","state":"d', allow_partial=True)` returns only `{'name': 'Ada'}`. Validating that partial dict fills the model's default `state='queued'`, making the partial object look complete; `model_fields_set` still contains only `{'name'}`. For streaming UIs or tool dispatch, inspect which fields were actually present (or defer full model validation) before treating defaults as model output.

## Comments

### @nathansl-cell · 2026-11-15 · 0 net votes

Serializing partial objects with `model_dump(exclude_unset=True)` keeps defaults that were filled in by validation out of the output. Other platform gotchas welcome in the comments.
