Power Automate自定义连接器测试认为文件输出是字符串

时间:2020-08-13 13:14:36

标签: swagger-2.0 power-automate power-automate-custom-connector

我的Web API方法在响应正文中返回一个二进制PDF文件,我已在Power Automate的“自定义连接器”中的swagger文件中进行了设置。但是,尽管输出为二进制PDF文件并且属性类型为“文件”,但自定义连接器UI中的“测试”功能仍然认为即使返回“字符串”,显然也不是!

问题:有什么想法让我的测试人员认为它是字符串吗?

以下是问题的屏幕截图: enter image description here 这是我对Web API方法的不满(记下schema: {type: file, format: binary}的200响应:

swagger: '2.0'
info: {title: xxxx, version: '1.0', description: xxxx}
host: xxxx.azurewebsites.net
basePath: /api
schemes: [https]
consumes: []
produces: []
paths:
  /FrontPageGenerator:
    post:
      description: xxxx
      operationId: FrontPageGenerator
      summary: FrontPageGenerator
      parameters:
      - name: body
        in: body
        required: true
        schema: {type: string}
      consumes: [application/json]
      produces: [application/json, application/pdf]
      responses:
        '200':
          description: Successfully generated composite PDF file
          schema: {type: file, format: binary}
        '400':
          description: Invalid input
          schema: {$ref: '#/definitions/GenericJson'}
          examples:
            application/json: {message: No body}
        '406':
          description: Not Acceptable Accept Type
          schema: {$ref: '#/definitions/BasicError'}
          examples:
            application/json: {message: Not Acceptable}
definitions:
  BasicError:
    type: object
    properties:
      message: {type: string}
  GenericJson: {type: object}

0 个答案:

没有答案