Exposes a plain Python function as an HTTP endpoint using Flask, performs type checking bewteen HTTP request and Python 3.6 type hints to give the client a clear error before calling the function. A GET request retrieves the documentation and type hints for that function
Work in progress, don't hesitate forking/asking/suggesting
See example.py for a complete example, in short:
this will expose your multiplier function at /mul, with the result that a POST of a JSON will be validated against type hints and give a JSON answer or nice error message if not matching. A GET for that endpoint will show the rendered pydoc string and the type hints.
Type checking (based on Python 3.6 typing):
Documentation:
Correct call:
A customized doc template can be passed as doc_html_template when instantiating the server and documentation endpoint can be disabled on single functions by passing auto_document=False