rest-json.json 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. [
  2. {
  3. "description": "Scalar members",
  4. "metadata": {
  5. "protocol": "rest-json"
  6. },
  7. "shapes": {
  8. "OutputShape": {
  9. "type": "structure",
  10. "members": {
  11. "ImaHeader": {
  12. "shape": "HeaderShape"
  13. },
  14. "ImaHeaderLocation": {
  15. "shape": "HeaderShape",
  16. "locationName": "X-Foo"
  17. },
  18. "Status": {
  19. "shape": "StatusShape",
  20. "location": "statusCode"
  21. },
  22. "Str": {
  23. "shape": "StringType"
  24. },
  25. "Num": {
  26. "shape": "IntegerType"
  27. },
  28. "FalseBool": {
  29. "shape": "BooleanType"
  30. },
  31. "TrueBool": {
  32. "shape": "BooleanType"
  33. },
  34. "Float": {
  35. "shape": "FloatType"
  36. },
  37. "Double": {
  38. "shape": "DoubleType"
  39. },
  40. "Long": {
  41. "shape": "LongType"
  42. },
  43. "Char": {
  44. "shape": "CharType"
  45. }
  46. }
  47. },
  48. "HeaderShape": {
  49. "type": "string",
  50. "location": "header"
  51. },
  52. "StatusShape": {
  53. "type": "integer"
  54. },
  55. "StringType": {
  56. "type": "string"
  57. },
  58. "IntegerType": {
  59. "type": "integer"
  60. },
  61. "BooleanType": {
  62. "type": "boolean"
  63. },
  64. "FloatType": {
  65. "type": "float"
  66. },
  67. "DoubleType": {
  68. "type": "double"
  69. },
  70. "LongType": {
  71. "type": "long"
  72. },
  73. "CharType": {
  74. "type": "character"
  75. }
  76. },
  77. "cases": [
  78. {
  79. "given": {
  80. "output": {
  81. "shape": "OutputShape"
  82. },
  83. "name": "OperationName"
  84. },
  85. "result": {
  86. "ImaHeader": "test",
  87. "ImaHeaderLocation": "abc",
  88. "Status": 200,
  89. "Str": "myname",
  90. "Num": 123,
  91. "FalseBool": false,
  92. "TrueBool": true,
  93. "Float": 1.2,
  94. "Double": 1.3,
  95. "Long": 200,
  96. "Char": "a"
  97. },
  98. "response": {
  99. "status_code": 200,
  100. "headers": {
  101. "ImaHeader": "test",
  102. "X-Foo": "abc"
  103. },
  104. "body": "{\"Str\": \"myname\", \"Num\": 123, \"FalseBool\": false, \"TrueBool\": true, \"Float\": 1.2, \"Double\": 1.3, \"Long\": 200, \"Char\": \"a\"}"
  105. }
  106. }
  107. ]
  108. },
  109. {
  110. "description": "Blob members",
  111. "metadata": {
  112. "protocol": "rest-json"
  113. },
  114. "shapes": {
  115. "OutputShape": {
  116. "type": "structure",
  117. "members": {
  118. "BlobMember": {
  119. "shape": "BlobType"
  120. },
  121. "StructMember": {
  122. "shape": "BlobContainer"
  123. }
  124. }
  125. },
  126. "BlobType": {
  127. "type": "blob"
  128. },
  129. "BlobContainer": {
  130. "type": "structure",
  131. "members": {
  132. "foo": {
  133. "shape": "BlobType"
  134. }
  135. }
  136. }
  137. },
  138. "cases": [
  139. {
  140. "given": {
  141. "output": {
  142. "shape": "OutputShape"
  143. },
  144. "name": "OperationName"
  145. },
  146. "result": {
  147. "BlobMember": "hi!",
  148. "StructMember": {
  149. "foo": "there!"
  150. }
  151. },
  152. "response": {
  153. "status_code": 200,
  154. "headers": {},
  155. "body": "{\"BlobMember\": \"aGkh\", \"StructMember\": {\"foo\": \"dGhlcmUh\"}}"
  156. }
  157. }
  158. ]
  159. },
  160. {
  161. "description": "Timestamp members",
  162. "metadata": {
  163. "protocol": "rest-json"
  164. },
  165. "shapes": {
  166. "OutputShape": {
  167. "type": "structure",
  168. "members": {
  169. "TimeMember": {
  170. "shape": "TimeType"
  171. },
  172. "StructMember": {
  173. "shape": "TimeContainer"
  174. }
  175. }
  176. },
  177. "TimeType": {
  178. "type": "timestamp"
  179. },
  180. "TimeContainer": {
  181. "type": "structure",
  182. "members": {
  183. "foo": {
  184. "shape": "TimeType"
  185. }
  186. }
  187. }
  188. },
  189. "cases": [
  190. {
  191. "given": {
  192. "output": {
  193. "shape": "OutputShape"
  194. },
  195. "name": "OperationName"
  196. },
  197. "result": {
  198. "TimeMember": 1398796238,
  199. "StructMember": {
  200. "foo": 1398796238
  201. }
  202. },
  203. "response": {
  204. "status_code": 200,
  205. "headers": {},
  206. "body": "{\"TimeMember\": 1398796238, \"StructMember\": {\"foo\": 1398796238}}"
  207. }
  208. }
  209. ]
  210. },
  211. {
  212. "description": "Lists",
  213. "metadata": {
  214. "protocol": "rest-json"
  215. },
  216. "shapes": {
  217. "OutputShape": {
  218. "type": "structure",
  219. "members": {
  220. "ListMember": {
  221. "shape": "ListType"
  222. }
  223. }
  224. },
  225. "ListType": {
  226. "type": "list",
  227. "member": {
  228. "shape": "StringType"
  229. }
  230. },
  231. "StringType": {
  232. "type": "string"
  233. }
  234. },
  235. "cases": [
  236. {
  237. "given": {
  238. "output": {
  239. "shape": "OutputShape"
  240. },
  241. "name": "OperationName"
  242. },
  243. "result": {
  244. "ListMember": ["a", "b"]
  245. },
  246. "response": {
  247. "status_code": 200,
  248. "headers": {},
  249. "body": "{\"ListMember\": [\"a\", \"b\"]}"
  250. }
  251. }
  252. ]
  253. },
  254. {
  255. "description": "Lists with structure member",
  256. "metadata": {
  257. "protocol": "rest-json"
  258. },
  259. "shapes": {
  260. "OutputShape": {
  261. "type": "structure",
  262. "members": {
  263. "ListMember": {
  264. "shape": "ListType"
  265. }
  266. }
  267. },
  268. "ListType": {
  269. "type": "list",
  270. "member": {
  271. "shape": "SingleStruct"
  272. }
  273. },
  274. "StringType": {
  275. "type": "string"
  276. },
  277. "SingleStruct": {
  278. "type": "structure",
  279. "members": {
  280. "Foo": {
  281. "shape": "StringType"
  282. }
  283. }
  284. }
  285. },
  286. "cases": [
  287. {
  288. "given": {
  289. "output": {
  290. "shape": "OutputShape"
  291. },
  292. "name": "OperationName"
  293. },
  294. "result": {
  295. "ListMember": [{"Foo": "a"}, {"Foo": "b"}]
  296. },
  297. "response": {
  298. "status_code": 200,
  299. "headers": {},
  300. "body": "{\"ListMember\": [{\"Foo\": \"a\"}, {\"Foo\": \"b\"}]}"
  301. }
  302. }
  303. ]
  304. },
  305. {
  306. "description": "Maps",
  307. "metadata": {
  308. "protocol": "rest-json"
  309. },
  310. "shapes": {
  311. "OutputShape": {
  312. "type": "structure",
  313. "members": {
  314. "MapMember": {
  315. "shape": "MapType"
  316. }
  317. }
  318. },
  319. "MapType": {
  320. "type": "map",
  321. "key": {
  322. "shape": "StringType"
  323. },
  324. "value": {
  325. "shape": "ListType"
  326. }
  327. },
  328. "ListType": {
  329. "type": "list",
  330. "member": {
  331. "shape": "IntegerType"
  332. }
  333. },
  334. "StringType": {
  335. "type": "string"
  336. },
  337. "IntegerType": {
  338. "type": "integer"
  339. }
  340. },
  341. "cases": [
  342. {
  343. "given": {
  344. "output": {
  345. "shape": "OutputShape"
  346. },
  347. "name": "OperationName"
  348. },
  349. "result": {
  350. "MapMember": {
  351. "a": [1, 2],
  352. "b": [3, 4]
  353. }
  354. },
  355. "response": {
  356. "status_code": 200,
  357. "headers": {},
  358. "body": "{\"MapMember\": {\"a\": [1, 2], \"b\": [3, 4]}}"
  359. }
  360. }
  361. ]
  362. },
  363. {
  364. "description": "Complex Map Values",
  365. "metadata": {
  366. "protocol": "rest-json"
  367. },
  368. "shapes": {
  369. "OutputShape": {
  370. "type": "structure",
  371. "members": {
  372. "MapMember": {
  373. "shape": "MapType"
  374. }
  375. }
  376. },
  377. "MapType": {
  378. "type": "map",
  379. "key": {
  380. "shape": "StringType"
  381. },
  382. "value": {
  383. "shape": "TimeType"
  384. }
  385. },
  386. "TimeType": {
  387. "type": "timestamp"
  388. },
  389. "StringType": {
  390. "type": "string"
  391. }
  392. },
  393. "cases": [
  394. {
  395. "given": {
  396. "output": {
  397. "shape": "OutputShape"
  398. },
  399. "name": "OperationName"
  400. },
  401. "result": {
  402. "MapMember": {
  403. "a": 1398796238,
  404. "b": 1398796238
  405. }
  406. },
  407. "response": {
  408. "status_code": 200,
  409. "headers": {},
  410. "body": "{\"MapMember\": {\"a\": 1398796238, \"b\": 1398796238}}"
  411. }
  412. }
  413. ]
  414. },
  415. {
  416. "description": "Ignores extra data",
  417. "metadata": {
  418. "protocol": "rest-json"
  419. },
  420. "shapes": {
  421. "OutputShape": {
  422. "type": "structure",
  423. "members": {
  424. "StrType": {
  425. "shape": "StrType"
  426. }
  427. }
  428. },
  429. "StrType": {
  430. "type": "string"
  431. }
  432. },
  433. "cases": [
  434. {
  435. "given": {
  436. "output": {
  437. "shape": "OutputShape"
  438. },
  439. "name": "OperationName"
  440. },
  441. "result": {},
  442. "response": {
  443. "status_code": 200,
  444. "headers": {},
  445. "body": "{\"foo\": \"bar\"}"
  446. }
  447. }
  448. ]
  449. },
  450. {
  451. "description": "Supports header maps",
  452. "metadata": {
  453. "protocol": "rest-json"
  454. },
  455. "shapes": {
  456. "OutputShape": {
  457. "type": "structure",
  458. "members": {
  459. "AllHeaders": {
  460. "shape": "HeaderMap",
  461. "location": "headers"
  462. },
  463. "PrefixedHeaders": {
  464. "shape": "HeaderMap",
  465. "location": "headers",
  466. "locationName": "X-"
  467. }
  468. }
  469. },
  470. "HeaderMap": {
  471. "type": "map",
  472. "key": {
  473. "shape": "StringType"
  474. },
  475. "value": {
  476. "shape": "StringType"
  477. }
  478. },
  479. "StringType": {
  480. "type": "string"
  481. }
  482. },
  483. "cases": [
  484. {
  485. "given": {
  486. "output": {
  487. "shape": "OutputShape"
  488. },
  489. "name": "OperationName"
  490. },
  491. "result": {
  492. "AllHeaders": {
  493. "Content-Length": "10",
  494. "X-Foo": "bar",
  495. "X-Bam": "boo"
  496. },
  497. "PrefixedHeaders": {
  498. "Foo": "bar",
  499. "Bam": "boo"
  500. }
  501. },
  502. "response": {
  503. "status_code": 200,
  504. "headers": {
  505. "Content-Length": "10",
  506. "X-Foo": "bar",
  507. "X-Bam": "boo"
  508. },
  509. "body": "{}"
  510. }
  511. }
  512. ]
  513. },
  514. {
  515. "description": "JSON payload",
  516. "metadata": {
  517. "protocol": "rest-json"
  518. },
  519. "shapes": {
  520. "OutputShape": {
  521. "type": "structure",
  522. "payload": "Data",
  523. "members": {
  524. "Header": {
  525. "shape": "StringType",
  526. "location": "header",
  527. "locationName": "X-Foo"
  528. },
  529. "Data": {
  530. "shape": "BodyStructure"
  531. }
  532. }
  533. },
  534. "BodyStructure": {
  535. "type": "structure",
  536. "members": {
  537. "Foo": {
  538. "shape": "StringType"
  539. }
  540. }
  541. },
  542. "StringType": {
  543. "type": "string"
  544. }
  545. },
  546. "cases": [
  547. {
  548. "given": {
  549. "output": {
  550. "shape": "OutputShape"
  551. },
  552. "name": "OperationName"
  553. },
  554. "result": {
  555. "Header": "baz",
  556. "Data": {
  557. "Foo": "abc"
  558. }
  559. },
  560. "response": {
  561. "status_code": 200,
  562. "headers": {
  563. "X-Foo": "baz"
  564. },
  565. "body": "{\"Foo\": \"abc\"}"
  566. }
  567. }
  568. ]
  569. },
  570. {
  571. "description": "Streaming payload",
  572. "metadata": {
  573. "protocol": "rest-json"
  574. },
  575. "shapes": {
  576. "OutputShape": {
  577. "type": "structure",
  578. "payload": "Stream",
  579. "members": {
  580. "Stream": {
  581. "shape": "Stream"
  582. }
  583. }
  584. },
  585. "Stream": {
  586. "type": "blob"
  587. }
  588. },
  589. "cases": [
  590. {
  591. "given": {
  592. "output": {
  593. "shape": "OutputShape"
  594. },
  595. "name": "OperationName"
  596. },
  597. "result": {
  598. "Stream": "abc"
  599. },
  600. "response": {
  601. "status_code": 200,
  602. "headers": {},
  603. "body": "abc"
  604. }
  605. }
  606. ]
  607. }
  608. ]