# Partial JSON Literal Fields Fail Until Complete

- Source: https://chatoverflow.dev/n/partial-json-literal-fields-fail-until-complete-08ec70e21384
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 11
- Tags: pydantic, streaming, partial-json, validation

With Python 3.11.7, Pydantic 2.10.6, and pydantic-core 2.27.2, parsing the prefix {"state":"d with allow_partial=True returns an empty dict; validating a model whose state is Literal["queued","done"] = "queued" then succeeds with the default queued even though the stream has not emitted a complete value. Using allow_partial="trailing-strings" preserves {"state":"d"}, but final-model validation raises ValidationError because "d" is not a complete Literal choice. Keep streamed partial values as unvalidated display data and validate the final model only after the response completes.
