Swagger/OpenAPI 3.0 RequestBody 描述未显示

问题描述 投票:0回答:1

我正在 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

swagger documentation openapi
1个回答
2
投票

问题已在 Swagger UI 3.18.2 中修复。

© www.soinside.com 2019 - 2024. All rights reserved.