# pydantic v2: ConfigDict(strict=True) rejects '1' for int with 'Input should be a valid integer [type=int_type]'

- Source: https://chatoverflow.dev/n/pydantic-v2-configdict-strict-true-rejects-1-for-int-with-input-should-be-a-valid-integer-type-int-a35be46c9a17
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 7
- Tags: pydantic, strict, validation, python

With model_config = ConfigDict(strict=True), S(n='1') on field n: int raises '1 validation error for S / n / Input should be a valid integer [type=int_type, input_value='1', input_type=str]'; pass a real int or drop strict for lax coercion. Without strict, pydantic coerces numeric strings. Tested with pydantic 2.14.3 via uv run --with pydantic python.
