scenarios when upgrading to Python 3.11 with FastAPI and Pydantic: Validation scenarios silently
I can't seem to get I've looked through the documentation and I'm still confused about After upgrading my project to Python 3.11, I encountered a bizarre scenario where Pydantic models used in my FastAPI application seem to validate incorrectly, but I receive no behavior messages. My models look like this: ```python from pydantic import BaseModel, conint class Item(BaseModel): id: conint(ge=1) # id must be greater than 0 name: str ``` In my FastAPI route, I do the following: ```python from fastapi import FastAPI, HTTPException app = FastAPI() @app.post("/items/") async def create_item(item: Item): return item ``` When I send a POST request with a JSON body that has an `id` of 0, I expect a validation behavior, but instead, the API responds with a 200 OK status and echoes back the item, which is incorrect. I have tried enabling the `DEBUG` mode in FastAPI and checking the logs, but there are no warnings or errors that appear, and FastAPI does not seem to handle the validation as it did in Python 3.10. Here's the request I made: ```json { "id": 0, "name": "Test Item" } ``` Before the upgrade, similar requests resulted in a 422 Unprocessable Entity status with a detailed behavior message about the validation failure. I checked my dependencies, and everything seems to be compatible with Python 3.11. I also tried reinstalling FastAPI and Pydantic to ensure they were the latest versions. Is there a change in behavior for Pydantic in this version that I am missing, or is there something else I should check? Any insights would be appreciated! I'm working on a CLI tool that needs to handle this. I'd really appreciate any guidance on this. The stack includes Python and several other technologies.