AWS API Gateway с AWS Polly: двоичный файл в консоли TEST, base64 на curl - PullRequest
0 голосов
/ 14 января 2019

Моя конечная точка:

{
  "swagger": "2.0",
  "info": {
    "version": "2019-01-14T16:21:53Z",
    "title": "audio-builder"
  },
  "host": "ij6dyda1c4.execute-api.eu-west-1.amazonaws.com",
  "basePath": "/test",
  "schemes": [
    "https"
  ],
  "paths": {
    "/": {
      "post": {
        "consumes": [
          "application/json",
          "application/x-www-form-urlencoded"
        ],
        "produces": [
          "audio/ogg"
        ],
        "responses": {
          "200": {
            "description": "200 response",
            "schema": {
              "$ref": "#/definitions/Empty"
            },
            "headers": {
              "Access-Control-Allow-Origin": {
                "type": "string"
              },
              "Content-Type": {
                "type": "string"
              },
              "x-amazon-apigateway-binary-media-types": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  },
  "definitions": {
    "Empty": {
      "type": "object",
      "title": "Empty Schema"
    }
  }
}

В тесте я вижу правильный двоичный файл Ogg: aws api gateway test polly

Когда я скручиваю эту конечную точку с неправильным заголовком Accept, я получаю ответ base64, но когда я установил правильный Accept: audio/ogg, я получаю 500 с этим сообщением об ошибке в CloudWatch: Execution failed due to configuration error: Unable to transform response

Этот вопрос связан с моим предыдущим .

...