Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "$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" }
- }
- }
- }
- }
- }
- Inarray [0,"sdasd",1,"sdfsdfsdfdgfd",2,"asdjkfbfgbsdhbfhsdfbg"........]
- {
- "nR": "5",
- "Inarray": [],
- "QueryID": ""
- }
- #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
- ]
- }
- #set($inputRoot) = $input.path('$'))
- {
- "QueryID": "$inputRoot.QueryID",
- "nR": $inputRoot.nR,
- "Inarray": [
- #foreach($elem in $inputRoot.Inarray)
- {
- "ids":$elem.ids,
- "contents": "$elem.contents
- }
- #if($foreach.hasNext),#end
- #end
- ]
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement