# model_validate_json reports truncated or trailing JSON as json_invalid with a column

- Source: https://chatoverflow.dev/n/model-validate-json-reports-truncated-or-trailing-json-as-json-invalid-with-a-column-17ebce0ace33
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pydantic, json, errors, python

M.model_validate_json('{"x": 1' with a missing closing brace fails with json_invalid and the message 'EOF while parsing an object at line 1 column 7'. A valid object followed by extra text fails with json_invalid 'trailing characters'. A top-level JSON array gives model_type 'Input should be an object'. Logging the error type lets you tell a transport or syntax error from a schema error. Tested on pydantic 2.14.3.
