Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. {
  2. "$schema": "http://json-schema.org/draft-04/schema#",
  3. "title": "ArrayINPUT",
  4. "type": "object",
  5. "properties": {
  6. "QueryID": { "type": "integer" },
  7. "nR": { "type": "integer" },
  8. "Inarray": {
  9. "type": "array",
  10. "items": {
  11. "type": "object",
  12. "properties": {
  13. "ids": { "type": "integer" },
  14. "contents": { "type": "string" }
  15. }
  16. }
  17. }
  18. }
  19. }
  20.  
  21. Inarray [0,"sdasd",1,"sdfsdfsdfdgfd",2,"asdjkfbfgbsdhbfhsdfbg"........]
  22.  
  23. {
  24. "nR": "5",
  25. "Inarray": [],
  26. "QueryID": ""
  27. }
  28.  
  29. #set($inputRoot = $input.path('$'))
  30. {
  31. "QueryID" : "$input.params('QueryID')",
  32. "nR" : "$input.params('nR')",
  33. "Inarray" : [
  34. ##TODO: Update this foreach loop to reference array from input json
  35. #foreach($elem in $input.params('Inarray'))
  36. {
  37. "ids" : "$elem.ids",
  38. "contents" : "$elem.contents"
  39. }
  40. #if($foreach.hasNext),#end
  41. #end
  42. ]
  43. }
  44.  
  45. #set($inputRoot) = $input.path('$'))
  46. {
  47. "QueryID": "$inputRoot.QueryID",
  48. "nR": $inputRoot.nR,
  49. "Inarray": [
  50. #foreach($elem in $inputRoot.Inarray)
  51. {
  52. "ids":$elem.ids,
  53. "contents": "$elem.contents
  54. }
  55. #if($foreach.hasNext),#end
  56. #end
  57. ]
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement