In the current implementation, the input, output, doc, and auth_required are standalone decorators, which makes it hard to config the internal behavior since it can't access the config object. I'm thinking of changing them to methods of APIFlask class:
from apiflask import APIFlask
app = APIFlask(__name__)
@app.get('/')
@app.input(PetInSchema)
@app.output(PetOutSchema)
def hello(data):
return 'Hello'
With this change, we can easily implement:
- More support for pagination
- Skip all validation for input with a global configuration variable
- Support external authentication libraries
The initial plan: