Amazon API Gatewayで文字列を返却する時はダブルクォーテーションで囲まれてしまう。
$ curl https://alstvax2jk.execute-api.ap-northeast-1.amazonaws.com/prod/str
"string"
これをクォーテーションなしで返却するには以下の設定が必要。
-
GET/POST等の
ResourcesのMethod ExecutionでIntegration Responseをクリック

-
Output PassthroughをMapping Templateにし、templateで$input.path('$')と設定

-
✓ボタンで保存 -
Deploy
これでOK。
$ curl https://alstvax2jk.execute-api.ap-northeast-1.amazonaws.com/prod/str
string
早くawscliで出来るようになりたい。。
参考:
https://forums.aws.amazon.com/thread.jspa?messageID=678603
