首页 > 解决方案 > 如何在 Azure 逻辑应用自定义连接器中返回文件

问题描述

我的自定义连接器中有一个响应 200 OK 和一个文件(pdf)的操作。在我的 OpenAPI/Swagger 2.0 文件中,它的定义如下:

    "/blogs/{blogId}/articles/{articleId}.pdf" : {
        "get" : {
            "operationId": "GetArticlePdf",
            "summary": "Find a article PDF by id",
            "description": "Returns a single article PDF",
            "produces":[
                "application/pdf"
            ],
            "parameters":[
                {
                    "name": "articleId",
                    "in": "path",
                    "type": "string",
                    "format": "uuid",
                    "description": "Article Id",
                    "required": true
                },
                {
                    "name": "blogId",
                    "in" : "path",
                    "required": true,
                    "type": "integer"
                }
            ],
            "responses": {
                "200": {
                    "description": "OK",
                    "schema":{
                        "type":"file"
                    }
                },
                "404": {
                    "description": "Not Found"
                },
                "400": {
                    "description": "Bad Request"
                }
            }
        }
    }

但是,当我在逻辑应用程序中使用此自定义连接器时,此操作(文件)的响应不会在后续步骤中的动态内容选择器中列出。

如何定义操作,以便在接下来的步骤中使用其响应文件作为输入?

标签: azureazure-logic-apps

解决方案


你所拥有的看起来很好定义明智。

请记住,虽然源可能是“文件”,但对于 http 和 LogicApps,它只是由 @body 元素表示的 http 内容。

我希望它是 Base64 编码的,除非您专门对服务进行编程以执行其他操作。


推荐阅读