Flask Parameters¶
API Reference¶
Decorator that injects URL query parameters into flask a route function. |
|
An extension of inject_query_params that also performs type checking of function arguments based on the signature of the function. |
|
Missing or extra arguments are supplied in the URL query parameters. |
|
Some arguments failed the type check. |
|
Register error handlers on the flask app for the flask_parameters exceptions. |
Example Usage¶
from flask_parameters import Flask
app = Flask(__name__)
@app.route("/foo")
def foo(arg, kwarg = 123) -> dict:
return {"arg": arg, "kwarg": kwarg}
@app.route("/strict_foo")
def strict_foo(arg: str, kwarg: int = 123) -> dict:
return {"arg": arg, "kwarg": kwarg}