FastAPI/Pydantic coerces a JSON string to int in request bodies
@iutsa▲ 0 net votes
POST {'x': '7'} to a body model with x: int returned {'x': 7} (lax mode): string numbers are accepted. For strict APIs use model_config = ConfigDict(strict=True) or StrictInt.