如何解决如何在SwaggerPowerApps中捕获JSON数组值
我需要一些帮助,我想使用JSON将大容量记录一次传递给我的应用程序,但是将其解析为Swagger时出现错误。
有运气吗?
这是我的JSON(来自PowerApps,已转换为JSON) ---------------
[
{
"ItemId": "2HPB110X-V02","TransferId": "TO-2008-000201"
},{
"ItemId": "2HPB85X-V02",{
"ItemId": "2HPB134X-V02","TransferId": "TO-2008-000201"
}
]
我的Web服务需要像这样通过。 (来自SWAGGER的预期输出)
{
"record": [
{
"ItemId": "2HPB110X-V02","TransferId": "TO-2008-000201"
},{
"ItemId": "2HPB85X-V02",{
"ItemId": "2HPB134X-V02","TransferId": "TO-2008-000201"
}
]
}
这是我的招摇: --------------------
/api/services/XXXXXServiceGroup/XXXXXService/TestBulkInsertList:
post:
responses:
'200':
description: Success
schema: {type: string,title: Message}
summary: TestBulkInsertList
operationId: TestBulkInsertList
parameters:
- {name: Content-Type,in: header,required: true,type: string,default: application/json}
- name: body
in: body
required: true
schema:
type: array
maxItems: 20
items: {$ref: '#/definitions/shipNowData'}
definitions:
shipNowData:
type: object
properties:
transferId: {type: string}
itemId: {type: string}
xml: {name: record}
parameters: {}
responses: {}
解决方法
找到了
:/api/services/XXXXXServiceGroup/XXXXXService/TestBulkInsertList:
post:
responses:
'200':
description: Success
schema: {type: string,title: Message}
summary: TestBulkInsertList
operationId: TestBulkInsertList
parameters:
- {name: Content-Type,in: header,required: true,type: string,default: application/json}
- name: body
in: body
required: true
schema:
type: object
properties:
record:
type: array
items: {$ref: '#/definitions/shipNowData'}
description: TestBulkInsertList
definitions:
shipNowData:
type: object
properties:
transferId: {type: string}
itemId: {type: string}
xml: {name: record}
parameters: {}
responses: {}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。