Python 为什么不是';请求主体是否显示在Flask Swagger UI中?

Python 为什么不是';请求主体是否显示在Flask Swagger UI中?,python,flask,swagger,Python,Flask,Swagger,我正在尝试使用flasger库编写API文档: @bp.route('/long\u to\u short',methods=['POST'] def long_to_short(): ''创建一个短URL --- 标签: -从长到短 请求主体: 内容: 应用程序/json: 模式: 类型:数组 项目: 长地址:https://google.com 必填项:true ''' 但UI不显示有关请求正文的信息: 如何正确编写文档,以便正确显示?希望这对您有用 tags: - long_

我正在尝试使用
flasger
库编写API文档:

@bp.route('/long\u to\u short',methods=['POST']
def long_to_short():
''创建一个短URL
---
标签:
-从长到短
请求主体:
内容:
应用程序/json:
模式:
类型:数组
项目:
长地址:https://google.com
必填项:true
'''
但UI不显示有关请求正文的信息:
如何正确编写文档,以便正确显示?

希望这对您有用

   tags:
   - long_to_short
   consumes:
   - "application/json"
   parameters:
   - in: "body"
     name: "body"
     required: true
     schema:
       type: "array"
       items:
        type: "object"
        properties:
         long_url:
         type: "string"
         example: "https://google.com"

以下是有效的标记:

@bp.route('/long\u to\u short',methods=['POST']
def long_to_short():
''创建一个短URL
---
标签:
-从长到短
请求主体:
内容:
应用程序/json:
模式:
$ref:“#定义/缩写”
定义:
缩短者:
类型:对象
必修的:
-从长到短
特性:
长到短:
类型:字符串
例子:https://google.com
'''

no,这样一来,招摇过市者根本就不会定义标记