OpenApi Documentation¶
OpenApi documentation is automatically generated by Flask Hintful.
To access the SwaggerUI the default route is /swagger
. The default route for the OpenApi JSON specfication is /openapi.json
Security¶
You can tell OpenApi which kind of security your application is expecting.
Currently, only these authentication types are supported: Bearer, ApiKey, Basic
app = Flask(__name__)
api = FlaskHintful(app, openapi_security=['bearer', 'apikey', 'basic'])
Note: This is just for OpenApi documentation, Flask-Hintful does not handle authentication/authorization.
Custom Routes¶
You can change the routes that we are serving the SwaggerUI and OpenApi JSON using these two configurations in your Flask App.
app = Flask(__name__)
app.config['FLASK_HINTFUL_OPENAPI_JSON_URL'] = '/custom_openapi.json'
app.config['FLASK_HINTFUL_OPENAPI_UI_URL'] = '/custom_swagger'
api = FlaskHintful(app)