json.json 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495
  1. [
  2. {
  3. "description": "Scalar members",
  4. "metadata": {
  5. "protocol": "json"
  6. },
  7. "shapes": {
  8. "OutputShape": {
  9. "type": "structure",
  10. "members": {
  11. "Str": {
  12. "shape": "StringType"
  13. },
  14. "Num": {
  15. "shape": "IntegerType"
  16. },
  17. "FalseBool": {
  18. "shape": "BooleanType"
  19. },
  20. "TrueBool": {
  21. "shape": "BooleanType"
  22. },
  23. "Float": {
  24. "shape": "FloatType"
  25. },
  26. "Double": {
  27. "shape": "DoubleType"
  28. },
  29. "Long": {
  30. "shape": "LongType"
  31. },
  32. "Char": {
  33. "shape": "CharType"
  34. }
  35. }
  36. },
  37. "StringType": {
  38. "type": "string"
  39. },
  40. "IntegerType": {
  41. "type": "integer"
  42. },
  43. "BooleanType": {
  44. "type": "boolean"
  45. },
  46. "FloatType": {
  47. "type": "float"
  48. },
  49. "DoubleType": {
  50. "type": "double"
  51. },
  52. "LongType": {
  53. "type": "long"
  54. },
  55. "CharType": {
  56. "type": "character"
  57. }
  58. },
  59. "cases": [
  60. {
  61. "given": {
  62. "output": {
  63. "shape": "OutputShape"
  64. },
  65. "name": "OperationName"
  66. },
  67. "result": {
  68. "Str": "myname",
  69. "Num": 123,
  70. "FalseBool": false,
  71. "TrueBool": true,
  72. "Float": 1.2,
  73. "Double": 1.3,
  74. "Long": 200,
  75. "Char": "a"
  76. },
  77. "response": {
  78. "status_code": 200,
  79. "headers": {},
  80. "body": "{\"Str\": \"myname\", \"Num\": 123, \"FalseBool\": false, \"TrueBool\": true, \"Float\": 1.2, \"Double\": 1.3, \"Long\": 200, \"Char\": \"a\"}"
  81. }
  82. }
  83. ]
  84. },
  85. {
  86. "description": "Blob members",
  87. "metadata": {
  88. "protocol": "json"
  89. },
  90. "shapes": {
  91. "OutputShape": {
  92. "type": "structure",
  93. "members": {
  94. "BlobMember": {
  95. "shape": "BlobType"
  96. },
  97. "StructMember": {
  98. "shape": "BlobContainer"
  99. }
  100. }
  101. },
  102. "BlobType": {
  103. "type": "blob"
  104. },
  105. "BlobContainer": {
  106. "type": "structure",
  107. "members": {
  108. "foo": {
  109. "shape": "BlobType"
  110. }
  111. }
  112. }
  113. },
  114. "cases": [
  115. {
  116. "given": {
  117. "output": {
  118. "shape": "OutputShape"
  119. },
  120. "name": "OperationName"
  121. },
  122. "result": {
  123. "BlobMember": "hi!",
  124. "StructMember": {
  125. "foo": "there!"
  126. }
  127. },
  128. "response": {
  129. "status_code": 200,
  130. "headers": {},
  131. "body": "{\"BlobMember\": \"aGkh\", \"StructMember\": {\"foo\": \"dGhlcmUh\"}}"
  132. }
  133. }
  134. ]
  135. },
  136. {
  137. "description": "Timestamp members",
  138. "metadata": {
  139. "protocol": "json"
  140. },
  141. "shapes": {
  142. "OutputShape": {
  143. "type": "structure",
  144. "members": {
  145. "TimeArg": {
  146. "shape": "TimestampType"
  147. },
  148. "TimeCustom": {
  149. "timestampFormat": "rfc822",
  150. "shape": "TimestampType"
  151. },
  152. "TimeFormat": {
  153. "shape": "TimestampFormatType"
  154. },
  155. "StructMember": {
  156. "shape": "TimeContainer"
  157. }
  158. }
  159. },
  160. "TimeContainer": {
  161. "type": "structure",
  162. "members": {
  163. "foo": {
  164. "shape": "TimestampType"
  165. },
  166. "bar": {
  167. "shape": "TimestampFormatType"
  168. }
  169. }
  170. },
  171. "TimestampFormatType": {
  172. "timestampFormat": "iso8601",
  173. "type": "timestamp"
  174. },
  175. "TimestampType": {
  176. "type": "timestamp"
  177. }
  178. },
  179. "cases": [
  180. {
  181. "given": {
  182. "output": {
  183. "shape": "OutputShape"
  184. },
  185. "name": "OperationName"
  186. },
  187. "result": {
  188. "TimeArg": 1398796238,
  189. "TimeCustom": 1398796238,
  190. "TimeFormat": 1398796238,
  191. "StructMember": {
  192. "foo": 1398796238,
  193. "bar": 1398796238
  194. }
  195. },
  196. "response": {
  197. "status_code": 200,
  198. "headers": {},
  199. "body": "{\"TimeArg\": 1398796238, \"TimeCustom\": \"Tue, 29 Apr 2014 18:30:38 GMT\", \"TimeFormat\": \"2014-04-29T18:30:38Z\", \"StructMember\": {\"foo\": 1398796238, \"bar\": \"2014-04-29T18:30:38Z\"}}"
  200. }
  201. }
  202. ]
  203. },
  204. {
  205. "description": "Lists",
  206. "metadata": {
  207. "protocol": "json"
  208. },
  209. "shapes": {
  210. "OutputShape": {
  211. "type": "structure",
  212. "members": {
  213. "ListMember": {
  214. "shape": "ListType"
  215. },
  216. "ListMemberMap": {
  217. "shape": "ListTypeMap"
  218. },
  219. "ListMemberStruct": {
  220. "shape": "ListTypeStruct"
  221. }
  222. }
  223. },
  224. "ListType": {
  225. "type": "list",
  226. "member": {
  227. "shape": "StringType"
  228. }
  229. },
  230. "ListTypeMap": {
  231. "type": "list",
  232. "member": {
  233. "shape": "MapType"
  234. }
  235. },
  236. "ListTypeStruct": {
  237. "type": "list",
  238. "member": {
  239. "shape": "StructType"
  240. }
  241. },
  242. "StringType": {
  243. "type": "string"
  244. },
  245. "StructType": {
  246. "type": "structure",
  247. "members": {
  248. }
  249. },
  250. "MapType": {
  251. "type": "map",
  252. "key": { "shape": "StringType" },
  253. "value": { "shape": "StringType" }
  254. }
  255. },
  256. "cases": [
  257. {
  258. "given": {
  259. "output": {
  260. "shape": "OutputShape"
  261. },
  262. "name": "OperationName"
  263. },
  264. "result": {
  265. "ListMember": ["a", "b"]
  266. },
  267. "response": {
  268. "status_code": 200,
  269. "headers": {},
  270. "body": "{\"ListMember\": [\"a\", \"b\"]}"
  271. }
  272. },
  273. {
  274. "given": {
  275. "output": {
  276. "shape": "OutputShape"
  277. },
  278. "name": "OperationName"
  279. },
  280. "result": {
  281. "ListMember": ["a", null],
  282. "ListMemberMap": [{}, null, null, {}],
  283. "ListMemberStruct": [{}, null, null, {}]
  284. },
  285. "response": {
  286. "status_code": 200,
  287. "headers": {},
  288. "body": "{\"ListMember\": [\"a\", null], \"ListMemberMap\": [{}, null, null, {}], \"ListMemberStruct\": [{}, null, null, {}]}"
  289. }
  290. }
  291. ]
  292. },
  293. {
  294. "description": "Maps",
  295. "metadata": {
  296. "protocol": "json"
  297. },
  298. "shapes": {
  299. "OutputShape": {
  300. "type": "structure",
  301. "members": {
  302. "MapMember": {
  303. "shape": "MapType"
  304. }
  305. }
  306. },
  307. "MapType": {
  308. "type": "map",
  309. "key": {
  310. "shape": "StringType"
  311. },
  312. "value": {
  313. "shape": "NumberList"
  314. }
  315. },
  316. "StringType": {
  317. "type": "string"
  318. },
  319. "NumberList": {
  320. "type": "list",
  321. "member": {
  322. "shape": "IntegerType"
  323. }
  324. },
  325. "IntegerType": {
  326. "type": "integer"
  327. }
  328. },
  329. "cases": [
  330. {
  331. "given": {
  332. "output": {
  333. "shape": "OutputShape"
  334. },
  335. "name": "OperationName"
  336. },
  337. "result": {
  338. "MapMember": {
  339. "a": [1, 2],
  340. "b": [3, 4]
  341. }
  342. },
  343. "response": {
  344. "status_code": 200,
  345. "headers": {},
  346. "body": "{\"MapMember\": {\"a\": [1, 2], \"b\": [3, 4]}}"
  347. }
  348. }
  349. ]
  350. },
  351. {
  352. "description": "Ignores extra data",
  353. "metadata": {
  354. "protocol": "json"
  355. },
  356. "shapes": {
  357. "OutputShape": {
  358. "type": "structure",
  359. "members": {
  360. "StrType": {
  361. "shape": "StrType"
  362. }
  363. }
  364. },
  365. "StrType": {
  366. "type": "string"
  367. }
  368. },
  369. "cases": [
  370. {
  371. "given": {
  372. "output": {
  373. "shape": "OutputShape"
  374. },
  375. "name": "OperationName"
  376. },
  377. "result": {},
  378. "response": {
  379. "status_code": 200,
  380. "headers": {},
  381. "body": "{\"foo\": \"bar\"}"
  382. }
  383. }
  384. ]
  385. },
  386. {
  387. "description": "Enum output",
  388. "metadata": {
  389. "protocol": "json"
  390. },
  391. "shapes": {
  392. "OutputShape": {
  393. "type": "structure",
  394. "members": {
  395. "FooEnum": {
  396. "shape": "JSONEnumType"
  397. },
  398. "ListEnums": {
  399. "shape": "JSONEnumList"
  400. }
  401. }
  402. },
  403. "JSONEnumType":{
  404. "type":"string",
  405. "enum":[
  406. "foo",
  407. "bar"
  408. ]
  409. },
  410. "JSONEnumList":{
  411. "type":"list",
  412. "member": {"shape": "JSONEnumType"}
  413. }
  414. },
  415. "cases": [
  416. {
  417. "given": {
  418. "output": {
  419. "shape": "OutputShape"
  420. },
  421. "name": "OperationName"
  422. },
  423. "result": {
  424. "FooEnum": "foo",
  425. "ListEnums": ["foo", "bar"]
  426. },
  427. "response": {
  428. "status_code": 200,
  429. "headers": {},
  430. "body": "{\"FooEnum\": \"foo\", \"ListEnums\": [\"foo\", \"bar\"]}"
  431. }
  432. }
  433. ]
  434. },
  435. {
  436. "description": "unmodeled non-json response payload",
  437. "metadata": {
  438. "protocol": "json"
  439. },
  440. "shapes": {
  441. "OutputShape": {
  442. "type": "structure",
  443. "members": {
  444. }
  445. }
  446. },
  447. "cases": [
  448. {
  449. "given": {
  450. "output": {
  451. "shape": "OutputShape"
  452. },
  453. "name": "OperationName"
  454. },
  455. "result": {
  456. },
  457. "response": {
  458. "status_code": 200,
  459. "headers": {},
  460. "body": "success"
  461. }
  462. },
  463. {
  464. "given": {
  465. "output": {
  466. "shape": "OutputShape"
  467. },
  468. "name": "OperationName"
  469. },
  470. "result": {
  471. },
  472. "response": {
  473. "status_code": 200,
  474. "headers": {},
  475. "body": "\"success\""
  476. }
  477. },
  478. {
  479. "given": {
  480. "output": {
  481. "shape": "OutputShape"
  482. },
  483. "name": "OperationName"
  484. },
  485. "result": {
  486. },
  487. "response": {
  488. "status_code": 200,
  489. "headers": {},
  490. "body": "{}"
  491. }
  492. }
  493. ]
  494. }
  495. ]