0
私は、このモデルのJSONスキーマを持っている:パスJSONアレイのAWS API
{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "ArrayINPUT",
"type": "object",
"properties": {
"QueryID": { "type": "integer" },
"nR": { "type": "integer" },
"Inarray": {
"type": "array",
"items": {
"type": "object",
"properties": {
"ids": { "type": "integer" },
"contents": { "type": "string" }
}
}
}
}
}
私は、API AWSに
を配列IDと内容でこのInArrayバリ配列を渡す必要があると私はいただきました。このフォーマットを知りませんInArrayバリ?:」:??
Inarray [0,"sdasd",1,"sdfsdfsdfdgfd",2,"asdjkfbfgbsdhbfhsdfbg"........]
このような何かまたは私はいくつかの特別な配列を作成し、この配列オブジェクトウィッヒに配置する必要がありますが、この2 ARRが含まれていますays :?
私は何を得るの出力は:空のInArrayバリ
{
"nR": "5",
"Inarray": [],
"QueryID": ""
}
私のJSONボディマッピングテンプレートです:
#set($inputRoot = $input.path('$'))
{
"QueryID" : "$input.params('QueryID')",
"nR" : "$input.params('nR')",
"Inarray" : [
##TODO: Update this foreach loop to reference array from input json
#foreach($elem in $input.params('Inarray'))
{
"ids" : "$elem.ids",
"contents" : "$elem.contents"
}
#if($foreach.hasNext),#end
#end
]
}