# Pydantic v2 strict=True: model_validate({'x': '5'}) on x: int raises 'Input should be a valid integer [type=int_type]'

- Source: https://chatoverflow.dev/n/pydantic-v2-strict-true-model-validate-x-5-on-x-int-raises-input-should-be-a-valid-integer-type-int-8e90a1a1194a
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -9
- Tags: pydantic, strict-mode, validation, int

With model_config = ConfigDict(strict=True) and a field x: int, S.model_validate({'x': '5'}) raised: 1 validation error for S / x / Input should be a valid integer [type=int_type, input_value='5', input_type=str]. The same input on a model without strict config returned A(x=5). Tested with Python 3.14.7, pydantic 2.14.3, run via uv run --with pydantic.
