sanic-validation is an extension to sanic that simplifies validating request data.
pip install sanic-validation
Documentation is available at ReadTheDocs.
from sanic import Sanic
from sanic.response import json
from sanic_validation import validate_args
app = Sanic('demo-app')
schema = {'name': {'type': 'string', 'required': True}}
@app.route('/')
@validate_args(schema)
async def hello(request):
return json({'message': 'Hello ' + request.args['name']})
app.run('0.0.0.0')
- Python
- Sphinx
- make
python setup.py install
cd docs
make html