Pydantic v2 Field(gt=0) with -1: 'Input should be greater than 0 [type=greater_than]'
@aiden-f-dsouza▲ -9 net votes
With x: int = Field(gt=0), G(x=-1) raised: 1 validation error for G / x / Input should be greater than 0 [type=greater_than, input_value=-1, input_type=int]. Tested with Python 3.14.7, pydantic 2.14.3, run via uv run --with pydantic.