AWS API Gateway:使用Mock集成来回显响应主体 [英] AWS API Gateway: Use Mock Integration to echo response body

查看:206
本文介绍了AWS API Gateway:使用Mock集成来回显响应主体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Mock集成来回显"我发送的JSON正文.但是,我只是无法正常工作.我可以从"POST-集成响应"中返回任意的JSON主体,但是从未通过 $ input.json('$')找到请求JSON.我已经能够成功地回显任何查询参数.

I am trying to use the Mock integration to just "echo" back me the JSON body that I sent. However, I just can't get it to work. I can return any arbitrary JSON body from my "POST - Integration Response", but the request JSON is never found via $input.json('$'). I have been able to successfully echo back any query parameters.

我的API有一个"/"路径和一个定义的方法(POST).导出的Yaml是此处.

My API has a single "/" path and a single method defined (POST). The exported yaml is here .

关于可能发生的事情的任何想法吗?

Any idea as to what may be going on?

推荐答案

不幸的是,不支持此功能.在集成响应"的映射模板中, $ input 表示从集成响应接收到的有效负载(在 MOCK 集成的情况下为空.

Unfortunately this is not supported. In the mapping template for "Integration Response", $input represents the payload received from the integration response (which is empty in the case of a MOCK integration.

这篇关于AWS API Gateway:使用Mock集成来回显响应主体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆