You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gcgj-dify-1.7.0/api/extensions/ext_swagger.py

24 lines
612 B
Python

from dify_app import DifyApp
def init_app(app: DifyApp):
from flasgger import Swagger
app.config["SWAGGER"] = {
"title": "API Docs",
"uiversion": 3,
"url_prefix": "/openapi",
"specs_route": "/",
"static_url_path": "/flasgger_static",
"securityDefinitions": {
"ApiKeyAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header",
"description": 'API Key Authorization header using Bearer scheme. Example: "Bearer {token}"',
}
},
}
Swagger(app)