You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While using flask_pydantic's validate; passing any unknown fields will cause a ValidationError, which is very desirable for many.
But in flask-openapi3 the _validate_query pre-processes in the incoming data and does all sort of things. But effectively filters out any unknown query parameters, which prevents the validation error.
In my opinion, the _validate_query should simply let the pydantic model do the validation. Similar to the _validate_path.
We currently also use
flask_pydantic
since that was our first step into getting pydantic incorporated into flask.It's
validate
function uses the pydantic model for the query as-is to check the incoming query parameters.Via
In our project we do the following:
While using
flask_pydantic
'svalidate
; passing any unknown fields will cause a ValidationError, which is very desirable for many.But in flask-openapi3 the
_validate_query
pre-processes in the incoming data and does all sort of things. But effectively filters out any unknown query parameters, which prevents the validation error.In my opinion, the
_validate_query
should simply let the pydantic model do the validation. Similar to the_validate_path
.The function seems overly complex. Just do this:
The text was updated successfully, but these errors were encountered: