AWS Api Gateway PHP SDK“输入传递=假”

时间:2018-10-04 06:22:45

标签: php amazon-web-services sdk aws-api-gateway

我正在尝试使用PHP SDK自动化我的API网关配置,以便可以在我的部署管道中使用它。

但是我遇到了一个错误,文档也不十分清楚。

我设法创建了所有资源和方法,发现的唯一问题是当我测试方法时出现此错误。

Thu Oct 04 06:15:44 UTC 2018 : Endpoint response body before transformations: {{PROPER JSON API RESPONSE}}, [TRUNCATED]
Thu Oct 04 06:15:44 UTC 2018 : Endpoint response headers: {Date=Thu, 04 Oct 2018 06:15:44 GMT, Content-Type=application/json, Transfer-Encoding=chunked, Connection=keep-alive, Server=Apache/2.4.18 (Ubuntu), Cache-Control=no-cache, private, Access-Control-Allow-Origin=*, Access-Control-Allow-Methods=POST, GET, OPTIONS, PUT, DELETE, Access-Control-Allow-Credentials=true, Access-Control-Max-Age=86400, Access-Control-Allow-Headers=Content-Type, Authorization, X-Requested-With, X-VERSION, Vary=Accept-Encoding}
Thu Oct 04 06:15:44 UTC 2018 : Execution failed due to configuration error: No match for output mapping and no default output mapping configured. Endpoint Response Status Code: 200
Thu Oct 04 06:15:44 UTC 2018 : Method completed with status: 500

我在Google / StackOverflow中找不到如何解决此问题的明确参考。

我用于生成方法的代码如下。

$this->client->putMethod([
            'apiKeyRequired' => false,
            'authorizationType' => 'NONE',
            'httpMethod' => 'GET',
            'resourceId' => $resource['id'],
            'restApiId' => getenv('API_GATEWAY_ID'),
        ]);

$this->client->putIntegration([
    'connectionType' => 'HTTP',
    'httpMethod' => 'GET',
    'integrationHttpMethod' => 'GET',
    'resourceId' => $resource['id'],
    'restApiId' => getenv('API_GATEWAY_ID'),
    'type' => 'HTTP',
    'uri' => getenv('API_DOMAIN') . $method['url'],
]);

如果我手动创建方法,则唯一的区别是输入直通,手动创建为True,上面的代码为False,但我找不到从API更改该值的方法。

0 个答案:

没有答案