LogicApp 自定义连接器动态模式响应字段

LogicApp custom connector dynamic schema response fields

我正在使用自定义连接器并尝试填充动态模式响应

使用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动态内容:

问题是为什么我还看到 BodyItem 字段,而它们没有出现在我的模式响应中:

{
    '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 中看到正文字段(例如)。对于有结果的活动只会产生该选项。因此它取决于 activity 。

有关详细信息,请参阅此 Microsoft 文档Call an API from a Logic Apps workflow using a custom connector & Extend an OpenAPI definition for a custom connector