-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi_entry.py
27 lines (22 loc) · 1.01 KB
/
api_entry.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- coding: utf-8 -*-
# @Time : 2024/5/8
# @Author : liuboyuan
from flask import Flask
from flask_restx import Api
def create_rest_api(application, version, title, description, doc):
return Api(application, version=version, title=title, description=description, doc=doc)
app = Flask("FischlApi")
rest_api_description = create_rest_api(app,
version="1.0",
title="Fischl Agent API",
description=""
"Fischl Agent API Documentation",
doc='/'
)
app.config.SWAGGER_UI_DOC_EXPANSION = 'list'
app.config.SWAGGER_UI_OPERATION_ID = True
app.config.SWAGGER_UI_REQUEST_DURATION = True
# disable Try it Out for all methods
app.config.SWAGGER_SUPPORTED_SUBMIT_METHODS = []
# enable Try it Out for specific methods
app.config.SWAGGER_SUPPORTED_SUBMIT_METHODS = ["get", "post"]