fastapi icon indicating copy to clipboard operation
fastapi copied to clipboard

🐛 Allow_inf_nan option for Param subclasses

Open pat-lasswell opened this issue 1 month ago • 2 comments

There was a typo in the __init__ method of the Param class which misnamed the allow_inf_nan option in the kwargs passed to the underlying Pydantic FieldInfo initializer. This resulted in the validator failing to enforce the constraint, and hence inf and nan values were being passed to the route handler when they should not have.

See https://github.com/tiangolo/fastapi/discussions/11577 for the original question.

pat-lasswell avatar May 15 '24 13:05 pat-lasswell