Swagger / OpenAPI 3.0 RequestBody说明未显示

时间:2018-06-26 22:33:06

标签: api swagger documentation openapi

今天,我尝试在Swagger中创建API文档。我直接尝试过openapi 3.0。我不知何故无法获得我的请求正文的描述。

requestBody:
    content:
      application/x-www-form-urlencoded:
        schema:
          type: object
          properties:
            name:
              description: The username of the user to be registered.
              type: string
            email:
              description: The E-Mail address of the user to be registered.
              type: string
            password:
              description: The password of the user to be registered.
              type: string
          required:
            - name
            - email
            - password

但是描述不会显示:

enter image description here

我想获得Swagger 2正在生成的内容。下面是将相同代码转换为Swagger 2的方式

enter image description here

1 个答案:

答案 0 :(得分:1)

issue在Swagger UI 3.18.2中已修复。