16 lines
422 B
Python
16 lines
422 B
Python
|
from flask import redirect, url_for
|
||
|
from flask.views import MethodView
|
||
|
import marshmallow as ma
|
||
|
|
||
|
from . import routes as blp
|
||
|
|
||
|
class OpenAPIGet(ma.Schema):
|
||
|
pass
|
||
|
|
||
|
@blp.route("/openapi")
|
||
|
class ApiVersion(MethodView):
|
||
|
@blp.doc(summary="Get the OpenAPI spec as a JSON.")
|
||
|
@blp.response(200, OpenAPIGet, description="Successful operation")
|
||
|
def get(self):
|
||
|
return redirect(url_for('api-docs.openapi_json'))
|