swagger未呈现请求正文

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

我有以下与openapi 3.0兼容的yaml文件,我正在尝试通过招摇来渲染。 yaml文件中未报告任何错误,但是requestBody不会在摇摇欲坠的GUI上呈现。我只是得到一个parameters字段,该字段为空,但未为请求正文呈现任何内容,也没有收到任何错误。下面的屏幕截图。

paths:
  /my-api:
    post:
      summary: My API Summary
      description: My API Description
      tags:
        - Cost Center
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/ReqBodyStruct'

Screnshot

如何通过招摇的gui显示RequestBody?我想念什么吗?

yaml swagger openapi swagger-editor
1个回答
1
投票

[根据Swagger UI github页面上的这两个问题OAS 3.0: Support for media type examples (aka request/response body examples) #3437Examples are not showing #2651,这应该在版本3.23.0(2019年6月29日)中修复。

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