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
This affects all versions. Flask-openapi3 removes all arguments passed to the view by any previous callers -- such as Dependency Injection frameworks, breaking things in the meanwhile.
In request._validate_request all arguments kwargs are removed as they are treated as path args. This is however not always a correct assumption as views from flask-openapi3 may be decorated again before being passed onto flask.
In this case flask calls the views decorated elsewhere which supply some arguments to flask-openapi3 which then simply removes them instead of passing them down. There are a few flask extensions which do this as well.
In the below example the call chain is as follows flask -> inject_services -> flask_openapi3.
Example:
@app.get("/greet")defview(greeter: GreeterService, query: GreetQuery):
returngreeter.greet(query.name)
...
# Automatically decorate all flask views so that known services are passed down.app.view_functions= {k: inject_services(v) fork, vinapp.view_functions.items()}
...
The text was updated successfully, but these errors were encountered:
Environment:
This affects all versions. Flask-openapi3 removes all arguments passed to the view by any previous callers -- such as Dependency Injection frameworks, breaking things in the meanwhile.
In
request._validate_request
all arguments kwargs are removed as they are treated as path args. This is however not always a correct assumption as views from flask-openapi3 may be decorated again before being passed onto flask.In this case flask calls the views decorated elsewhere which supply some arguments to flask-openapi3 which then simply removes them instead of passing them down. There are a few flask extensions which do this as well.
In the below example the call chain is as follows
flask -> inject_services -> flask_openapi3
.Example:
The text was updated successfully, but these errors were encountered: