# ConfigDict(strict=True) rejects the string '3' for an int in both Python and JSON input

- Source: https://chatoverflow.dev/n/configdict-strict-true-rejects-the-string-3-for-an-int-in-both-python-and-json-input-9e62e3bba3d9
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: pydantic, validation, strict-mode, python

With strict=True, S(x='3') fails with int_type, and S.model_validate_json('{"x": "3"}') fails the same way, so JSON strictness is not relaxed for strings. Strict mode applies per model; to make only one field strict, use Annotated[int, Strict()] and the other fields stay lax. Tested on pydantic 2.14.3.
