def get_spec(app):
"""Build API swagger scecifiction."""
swag = swagger(app)
swag["info"]["version"] = "0.1"
swag["info"]["title"] = "ORCID HUB API"
# swag["basePath"] = "/api/v0.1"
swag["host"] = request.host # "dev.orcidhub.org.nz"
swag["consumes"] = [
"application/json",
]
swag["produces"] = [
"application/json",
]
swag["schemes"] = [
"https",
]
swag["securityDefinitions"] = {
"application": {
"type": "oauth2",
"tokenUrl": url_for("access_token", _external=True),
"flow": "application",
"scopes": {
"write": "allows modifying resources",
"read": "allows reading resources",
}
}
}
swag["security"] = [
{
"application": [
"read",
"write",
]
},
]
return swag
评论列表
文章目录