rest-json.json 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799
  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. "TimeArg": {
  170. "shape": "TimestampType"
  171. },
  172. "TimeArgInHeader": {
  173. "shape": "TimestampType",
  174. "location": "header",
  175. "locationName": "x-amz-timearg"
  176. },
  177. "TimeCustom": {
  178. "timestampFormat": "rfc822",
  179. "shape": "TimestampType"
  180. },
  181. "TimeCustomInHeader": {
  182. "timestampFormat": "unixTimestamp",
  183. "shape": "TimestampType",
  184. "location": "header",
  185. "locationName": "x-amz-timecustom"
  186. },
  187. "TimeFormat": {
  188. "shape": "TimestampFormatType"
  189. },
  190. "TimeFormatInHeader": {
  191. "shape": "TimestampFormatType",
  192. "location": "header",
  193. "locationName": "x-amz-timeformat"
  194. },
  195. "StructMember": {
  196. "shape": "TimeContainer"
  197. }
  198. }
  199. },
  200. "TimeContainer": {
  201. "type": "structure",
  202. "members": {
  203. "foo": {
  204. "shape": "TimestampType"
  205. },
  206. "bar": {
  207. "shape": "TimestampFormatType"
  208. }
  209. }
  210. },
  211. "TimestampFormatType": {
  212. "timestampFormat": "iso8601",
  213. "type": "timestamp"
  214. },
  215. "TimestampType": {
  216. "type": "timestamp"
  217. }
  218. },
  219. "cases": [
  220. {
  221. "given": {
  222. "output": {
  223. "shape": "OutputShape"
  224. },
  225. "name": "OperationName"
  226. },
  227. "result": {
  228. "TimeArg": 1398796238,
  229. "TimeArgInHeader": 1398796238,
  230. "TimeCustom": 1398796238,
  231. "TimeCustomInHeader": 1398796238,
  232. "TimeFormat": 1398796238,
  233. "TimeFormatInHeader": 1398796238,
  234. "StructMember": {
  235. "foo": 1398796238,
  236. "bar": 1398796238
  237. }
  238. },
  239. "response": {
  240. "status_code": 200,
  241. "headers": {
  242. "x-amz-timearg": "Tue, 29 Apr 2014 18:30:38 GMT",
  243. "x-amz-timecustom": "1398796238",
  244. "x-amz-timeformat": "2014-04-29T18:30:38Z"
  245. },
  246. "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\"}}"
  247. }
  248. }
  249. ]
  250. },
  251. {
  252. "description": "Lists",
  253. "metadata": {
  254. "protocol": "rest-json"
  255. },
  256. "shapes": {
  257. "OutputShape": {
  258. "type": "structure",
  259. "members": {
  260. "ListMember": {
  261. "shape": "ListType"
  262. }
  263. }
  264. },
  265. "ListType": {
  266. "type": "list",
  267. "member": {
  268. "shape": "StringType"
  269. }
  270. },
  271. "StringType": {
  272. "type": "string"
  273. }
  274. },
  275. "cases": [
  276. {
  277. "given": {
  278. "output": {
  279. "shape": "OutputShape"
  280. },
  281. "name": "OperationName"
  282. },
  283. "result": {
  284. "ListMember": ["a", "b"]
  285. },
  286. "response": {
  287. "status_code": 200,
  288. "headers": {},
  289. "body": "{\"ListMember\": [\"a\", \"b\"]}"
  290. }
  291. }
  292. ]
  293. },
  294. {
  295. "description": "Lists with structure member",
  296. "metadata": {
  297. "protocol": "rest-json"
  298. },
  299. "shapes": {
  300. "OutputShape": {
  301. "type": "structure",
  302. "members": {
  303. "ListMember": {
  304. "shape": "ListType"
  305. }
  306. }
  307. },
  308. "ListType": {
  309. "type": "list",
  310. "member": {
  311. "shape": "SingleStruct"
  312. }
  313. },
  314. "StringType": {
  315. "type": "string"
  316. },
  317. "SingleStruct": {
  318. "type": "structure",
  319. "members": {
  320. "Foo": {
  321. "shape": "StringType"
  322. }
  323. }
  324. }
  325. },
  326. "cases": [
  327. {
  328. "given": {
  329. "output": {
  330. "shape": "OutputShape"
  331. },
  332. "name": "OperationName"
  333. },
  334. "result": {
  335. "ListMember": [{"Foo": "a"}, {"Foo": "b"}]
  336. },
  337. "response": {
  338. "status_code": 200,
  339. "headers": {},
  340. "body": "{\"ListMember\": [{\"Foo\": \"a\"}, {\"Foo\": \"b\"}]}"
  341. }
  342. }
  343. ]
  344. },
  345. {
  346. "description": "Maps",
  347. "metadata": {
  348. "protocol": "rest-json"
  349. },
  350. "shapes": {
  351. "OutputShape": {
  352. "type": "structure",
  353. "members": {
  354. "MapMember": {
  355. "shape": "MapType"
  356. }
  357. }
  358. },
  359. "MapType": {
  360. "type": "map",
  361. "key": {
  362. "shape": "StringType"
  363. },
  364. "value": {
  365. "shape": "ListType"
  366. }
  367. },
  368. "ListType": {
  369. "type": "list",
  370. "member": {
  371. "shape": "IntegerType"
  372. }
  373. },
  374. "StringType": {
  375. "type": "string"
  376. },
  377. "IntegerType": {
  378. "type": "integer"
  379. }
  380. },
  381. "cases": [
  382. {
  383. "given": {
  384. "output": {
  385. "shape": "OutputShape"
  386. },
  387. "name": "OperationName"
  388. },
  389. "result": {
  390. "MapMember": {
  391. "a": [1, 2],
  392. "b": [3, 4]
  393. }
  394. },
  395. "response": {
  396. "status_code": 200,
  397. "headers": {},
  398. "body": "{\"MapMember\": {\"a\": [1, 2], \"b\": [3, 4]}}"
  399. }
  400. }
  401. ]
  402. },
  403. {
  404. "description": "Complex Map Values",
  405. "metadata": {
  406. "protocol": "rest-json"
  407. },
  408. "shapes": {
  409. "OutputShape": {
  410. "type": "structure",
  411. "members": {
  412. "MapMember": {
  413. "shape": "MapType"
  414. }
  415. }
  416. },
  417. "MapType": {
  418. "type": "map",
  419. "key": {
  420. "shape": "StringType"
  421. },
  422. "value": {
  423. "shape": "TimeType"
  424. }
  425. },
  426. "TimeType": {
  427. "type": "timestamp"
  428. },
  429. "StringType": {
  430. "type": "string"
  431. }
  432. },
  433. "cases": [
  434. {
  435. "given": {
  436. "output": {
  437. "shape": "OutputShape"
  438. },
  439. "name": "OperationName"
  440. },
  441. "result": {
  442. "MapMember": {
  443. "a": 1398796238,
  444. "b": 1398796238
  445. }
  446. },
  447. "response": {
  448. "status_code": 200,
  449. "headers": {},
  450. "body": "{\"MapMember\": {\"a\": 1398796238, \"b\": 1398796238}}"
  451. }
  452. }
  453. ]
  454. },
  455. {
  456. "description": "Ignores extra data",
  457. "metadata": {
  458. "protocol": "rest-json"
  459. },
  460. "shapes": {
  461. "OutputShape": {
  462. "type": "structure",
  463. "members": {
  464. "StrType": {
  465. "shape": "StrType"
  466. }
  467. }
  468. },
  469. "StrType": {
  470. "type": "string"
  471. }
  472. },
  473. "cases": [
  474. {
  475. "given": {
  476. "output": {
  477. "shape": "OutputShape"
  478. },
  479. "name": "OperationName"
  480. },
  481. "result": {},
  482. "response": {
  483. "status_code": 200,
  484. "headers": {},
  485. "body": "{\"foo\": \"bar\"}"
  486. }
  487. }
  488. ]
  489. },
  490. {
  491. "description": "Supports header maps",
  492. "metadata": {
  493. "protocol": "rest-json"
  494. },
  495. "shapes": {
  496. "OutputShape": {
  497. "type": "structure",
  498. "members": {
  499. "AllHeaders": {
  500. "shape": "HeaderMap",
  501. "location": "headers"
  502. },
  503. "PrefixedHeaders": {
  504. "shape": "HeaderMap",
  505. "location": "headers",
  506. "locationName": "X-"
  507. }
  508. }
  509. },
  510. "HeaderMap": {
  511. "type": "map",
  512. "key": {
  513. "shape": "StringType"
  514. },
  515. "value": {
  516. "shape": "StringType"
  517. }
  518. },
  519. "StringType": {
  520. "type": "string"
  521. }
  522. },
  523. "cases": [
  524. {
  525. "given": {
  526. "output": {
  527. "shape": "OutputShape"
  528. },
  529. "name": "OperationName"
  530. },
  531. "result": {
  532. "AllHeaders": {
  533. "Content-Length": "10",
  534. "X-Foo": "bar",
  535. "X-Bam": "boo"
  536. },
  537. "PrefixedHeaders": {
  538. "Foo": "bar",
  539. "Bam": "boo"
  540. }
  541. },
  542. "response": {
  543. "status_code": 200,
  544. "headers": {
  545. "Content-Length": "10",
  546. "X-Foo": "bar",
  547. "X-Bam": "boo"
  548. },
  549. "body": "{}"
  550. }
  551. }
  552. ]
  553. },
  554. {
  555. "description": "JSON payload",
  556. "metadata": {
  557. "protocol": "rest-json"
  558. },
  559. "shapes": {
  560. "OutputShape": {
  561. "type": "structure",
  562. "payload": "Data",
  563. "members": {
  564. "Header": {
  565. "shape": "StringType",
  566. "location": "header",
  567. "locationName": "X-Foo"
  568. },
  569. "Data": {
  570. "shape": "BodyStructure"
  571. }
  572. }
  573. },
  574. "BodyStructure": {
  575. "type": "structure",
  576. "members": {
  577. "Foo": {
  578. "shape": "StringType"
  579. }
  580. }
  581. },
  582. "StringType": {
  583. "type": "string"
  584. }
  585. },
  586. "cases": [
  587. {
  588. "given": {
  589. "output": {
  590. "shape": "OutputShape"
  591. },
  592. "name": "OperationName"
  593. },
  594. "result": {
  595. "Header": "baz",
  596. "Data": {
  597. "Foo": "abc"
  598. }
  599. },
  600. "response": {
  601. "status_code": 200,
  602. "headers": {
  603. "X-Foo": "baz"
  604. },
  605. "body": "{\"Foo\": \"abc\"}"
  606. }
  607. }
  608. ]
  609. },
  610. {
  611. "description": "Streaming payload",
  612. "metadata": {
  613. "protocol": "rest-json"
  614. },
  615. "shapes": {
  616. "OutputShape": {
  617. "type": "structure",
  618. "payload": "Stream",
  619. "members": {
  620. "Stream": {
  621. "shape": "Stream"
  622. }
  623. }
  624. },
  625. "Stream": {
  626. "type": "blob"
  627. }
  628. },
  629. "cases": [
  630. {
  631. "given": {
  632. "output": {
  633. "shape": "OutputShape"
  634. },
  635. "name": "OperationName"
  636. },
  637. "result": {
  638. "Stream": "abc"
  639. },
  640. "response": {
  641. "status_code": 200,
  642. "headers": {},
  643. "body": "abc"
  644. }
  645. }
  646. ]
  647. },
  648. {
  649. "description": "JSON value trait",
  650. "metadata": {
  651. "protocol": "rest-json"
  652. },
  653. "shapes": {
  654. "OutputShape": {
  655. "type": "structure",
  656. "members": {
  657. "HeaderField": {
  658. "shape": "StringType",
  659. "jsonvalue": true,
  660. "location": "header",
  661. "locationName": "X-Amz-Foo"
  662. },
  663. "BodyField":{
  664. "shape": "StringType",
  665. "jsonvalue": true
  666. },
  667. "BodyListField": {
  668. "shape": "ListType"
  669. }
  670. }
  671. },
  672. "StringType": {
  673. "type": "string"
  674. },
  675. "ListType": {
  676. "type": "list",
  677. "member": {
  678. "shape": "StringType",
  679. "jsonvalue": true
  680. }
  681. }
  682. },
  683. "cases": [
  684. {
  685. "given": {
  686. "output": {
  687. "shape": "OutputShape"
  688. },
  689. "name": "OperationName"
  690. },
  691. "result": {
  692. "HeaderField": {"Foo":"Bar"},
  693. "BodyField": {"Foo":"Bar"}
  694. },
  695. "response": {
  696. "status_code": 200,
  697. "headers": {"X-Amz-Foo": "eyJGb28iOiJCYXIifQ=="},
  698. "body": "{\"BodyField\":\"{\\\"Foo\\\":\\\"Bar\\\"}\"}"
  699. }
  700. },
  701. {
  702. "given": {
  703. "output": {
  704. "shape": "OutputShape"
  705. },
  706. "name": "OperationName"
  707. },
  708. "result": {
  709. "BodyListField": [{"Foo":"Bar"}]
  710. },
  711. "response": {
  712. "status_code": 200,
  713. "headers": {},
  714. "body": "{\"BodyListField\":[\"{\\\"Foo\\\":\\\"Bar\\\"}\"]}"
  715. }
  716. }
  717. ]
  718. },
  719. {
  720. "description": "Enum",
  721. "metadata": {
  722. "protocol": "rest-json",
  723. "apiVersion": "2014-01-01"
  724. },
  725. "shapes": {
  726. "OutputShape": {
  727. "type": "structure",
  728. "members": {
  729. "HeaderEnum": {
  730. "shape": "RESTJSONEnumType",
  731. "location": "header",
  732. "locationName": "x-amz-enum"
  733. },
  734. "FooEnum": {
  735. "shape": "RESTJSONEnumType"
  736. },
  737. "ListEnums": {
  738. "shape": "EnumList"
  739. }
  740. }
  741. },
  742. "RESTJSONEnumType":{
  743. "type":"string",
  744. "enum":[
  745. "foo",
  746. "bar",
  747. "0",
  748. "1"
  749. ]
  750. },
  751. "EnumList":{
  752. "type":"list",
  753. "member": {"shape": "RESTJSONEnumType"}
  754. }
  755. },
  756. "cases": [
  757. {
  758. "given": {
  759. "output": {
  760. "shape": "OutputShape"
  761. },
  762. "http": {
  763. "method": "POST",
  764. "requestUri": "/path"
  765. },
  766. "name": "OperationName"
  767. },
  768. "result": {
  769. "HeaderEnum": "baz",
  770. "FooEnum": "foo",
  771. "ListEnums": ["foo", "bar"]
  772. },
  773. "response": {
  774. "status_code": 200,
  775. "headers": {"x-amz-enum": "baz"},
  776. "body": "{\"FooEnum\": \"foo\", \"ListEnums\": [\"foo\", \"bar\"]}"
  777. }
  778. },
  779. {
  780. "given": {
  781. "input": {
  782. "shape": "OutputShape"
  783. },
  784. "http": {
  785. "method": "POST",
  786. "requestUri": "/path"
  787. },
  788. "name": "OperationName"
  789. },
  790. "result": {
  791. },
  792. "response": {
  793. "status_code": 200,
  794. "headers": {}
  795. }
  796. }
  797. ]
  798. }
  799. ]