swagger 没有渲染请求体
swagger is not rendering requestbody
我有以下 openapi 3.0 兼容的 yaml 文件,我正试图通过 swagger 呈现它。 yaml 文件中没有报告错误,但 requestBody
未在 swagger 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'
如何获取在 swagger gui 中也显示的 RequestBody?我错过了什么吗?
根据 Swagger UI github 页面中的这两个问题 OAS 3.0: Support for media type examples (aka request/response body examples) #3437 and Examples are not showing #2651,这应该在版本 3.23.0
(2019 年 6 月 29 日)中得到修复。
我有以下 openapi 3.0 兼容的 yaml 文件,我正试图通过 swagger 呈现它。 yaml 文件中没有报告错误,但 requestBody
未在 swagger 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'
如何获取在 swagger gui 中也显示的 RequestBody?我错过了什么吗?
根据 Swagger UI github 页面中的这两个问题 OAS 3.0: Support for media type examples (aka request/response body examples) #3437 and Examples are not showing #2651,这应该在版本 3.23.0
(2019 年 6 月 29 日)中得到修复。