我正在使用自定义连接器并尝试填充动态架构响应
使用x-ms-dynamic-schema
这就是我的招摇:
responses:
'200':
description: Result
schema:
description: output description
type: object
x-ms-dynamic-schema:
operationId: OperationId
parameters:
ref: {parameter: ref}
value-path: output
这是 UI 动态内容:
问题是为什么我还看到 Body
和 Item
字段,而它们没有出现在我的架构响应中:
{
'output': {
'type': 'object',
'properties': {
'some_field1': {
'type': 'string',
'required': True
},
'some_field2': {
'type': 'string',
'required': True
},
'some_field3': {
'required': True,
'type': 'array',
'items': {
'type': 'number'
}
},
'some_field4': {
'required': True,
'type': 'integer'
}
}
}
}
最佳答案
谢谢@David Meu 的确认。将其作为答案发布以帮助其他社区成员。
Question is why am I seeing also Body and Item fields while they are not appearing in my schema response:
AFAIK,Body 和 Item 是内置对象,适用于先前步骤的任何结果,这些结果列在动态内容下。
当上一个结果的实体中有多个一个对象时,它会提供一个变量作为item,它引用结果中的每个实体,以便您可以轻松地在循环事件中引用以进行迭代。
Body 只是对先前步骤的结果或响应的完整引用,它是完整结果的 json
。
Because they are not appearing in other connectors responses (Outlook 365 for example)
我们可以在 Outlook 365
中看到正文字段(例如)。对于有结果的事件,只会产生该选项。因此,它取决于事件。
有关详细信息,请参阅此Microsoft 文档:Call an API from a Logic Apps workflow using a custom connector & Extend an OpenAPI definition for a custom connector
关于azure - LogicApp 自定义连接器动态架构响应字段,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70728770/