def spec():
"""Return the specification of the API."""
swag = get_spec(app)
best = request.accept_mimetypes.best_match(["text/yaml", "application/x-yaml"])
if (best in (
"text/yaml",
"application/x-yaml",
) and request.accept_mimetypes[best] > request.accept_mimetypes["application/json"]):
return yamlfy(swag)
else:
return jsonify(swag)
评论列表
文章目录