如何解决如何为带有数组的application / x-www-form-urlencoded请求定义Swagger
我有一个API,其卷曲请求如下:
curl --request POST \
--url 'http://some.url/api/Resource/findByIds' \
--header 'content-type: application/x-www-form-urlencoded' \
--data 'data[ids][]=100025' \
--data 'data[ids][]=100028'
这如何在OpenAPI(Swagger)请求定义和示例(版本3)中表示?
这是我到目前为止的内容,但是我似乎无法正确显示该示例。
api/Resource/findByIds:
post:
summary: Find resource by IDs
requestBody:
content:
application/x-www-form-urlencoded:
schema:
type: object
properties:
data:
type: object
properties:
ids:
type: array
description: IDs of resources to fetch
items:
type: integer
encoding:
data:
style: deepObject
explode: true
example:
data:
ids: [2334,234,20043]
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。