rest-xml.json 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720
  1. [
  2. {
  3. "description": "Scalar members",
  4. "metadata": {
  5. "protocol": "rest-xml"
  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. "Str": {
  19. "shape": "StringType"
  20. },
  21. "Num": {
  22. "shape": "IntegerType",
  23. "locationName": "FooNum"
  24. },
  25. "FalseBool": {
  26. "shape": "BooleanType"
  27. },
  28. "TrueBool": {
  29. "shape": "BooleanType"
  30. },
  31. "Float": {
  32. "shape": "FloatType"
  33. },
  34. "Double": {
  35. "shape": "DoubleType"
  36. },
  37. "Long": {
  38. "shape": "LongType"
  39. },
  40. "Char": {
  41. "shape": "CharType"
  42. },
  43. "Timestamp": {
  44. "shape": "TimestampType"
  45. }
  46. }
  47. },
  48. "StringType": {
  49. "type": "string"
  50. },
  51. "IntegerType": {
  52. "type": "integer"
  53. },
  54. "BooleanType": {
  55. "type": "boolean"
  56. },
  57. "FloatType": {
  58. "type": "float"
  59. },
  60. "DoubleType": {
  61. "type": "double"
  62. },
  63. "LongType": {
  64. "type": "long"
  65. },
  66. "CharType": {
  67. "type": "character"
  68. },
  69. "HeaderShape": {
  70. "type": "string",
  71. "location": "header"
  72. },
  73. "StatusShape": {
  74. "type": "integer",
  75. "location": "statusCode"
  76. },
  77. "TimestampType": {
  78. "type": "timestamp"
  79. }
  80. },
  81. "cases": [
  82. {
  83. "given": {
  84. "output": {
  85. "shape": "OutputShape"
  86. },
  87. "name": "OperationName"
  88. },
  89. "result": {
  90. "ImaHeader": "test",
  91. "ImaHeaderLocation": "abc",
  92. "Str": "myname",
  93. "Num": 123,
  94. "FalseBool": false,
  95. "TrueBool": true,
  96. "Float": 1.2,
  97. "Double": 1.3,
  98. "Long": 200,
  99. "Char": "a",
  100. "Timestamp": 1422172800
  101. },
  102. "response": {
  103. "status_code": 200,
  104. "headers": {
  105. "ImaHeader": "test",
  106. "X-Foo": "abc"
  107. },
  108. "body": "<OperationNameResponse><Str>myname</Str><FooNum>123</FooNum><FalseBool>false</FalseBool><TrueBool>true</TrueBool><Float>1.2</Float><Double>1.3</Double><Long>200</Long><Char>a</Char><Timestamp>2015-01-25T08:00:00Z</Timestamp></OperationNameResponse>"
  109. }
  110. },
  111. {
  112. "given": {
  113. "output": {
  114. "shape": "OutputShape"
  115. },
  116. "name": "OperationName"
  117. },
  118. "result": {
  119. "ImaHeader": "test",
  120. "ImaHeaderLocation": "abc",
  121. "Str": "",
  122. "Num": 123,
  123. "FalseBool": false,
  124. "TrueBool": true,
  125. "Float": 1.2,
  126. "Double": 1.3,
  127. "Long": 200,
  128. "Char": "a",
  129. "Timestamp": 1422172800
  130. },
  131. "response": {
  132. "status_code": 200,
  133. "headers": {
  134. "ImaHeader": "test",
  135. "X-Foo": "abc"
  136. },
  137. "body": "<OperationNameResponse><Str></Str><FooNum>123</FooNum><FalseBool>false</FalseBool><TrueBool>true</TrueBool><Float>1.2</Float><Double>1.3</Double><Long>200</Long><Char>a</Char><Timestamp>2015-01-25T08:00:00Z</Timestamp></OperationNameResponse>"
  138. }
  139. }
  140. ]
  141. },
  142. {
  143. "description": "Blob",
  144. "metadata": {
  145. "protocol": "rest-xml"
  146. },
  147. "shapes": {
  148. "OutputShape": {
  149. "type": "structure",
  150. "members": {
  151. "Blob": {
  152. "shape": "BlobType"
  153. }
  154. }
  155. },
  156. "BlobType": {
  157. "type": "blob"
  158. }
  159. },
  160. "cases": [
  161. {
  162. "given": {
  163. "output": {
  164. "shape": "OutputShape"
  165. },
  166. "name": "OperationName"
  167. },
  168. "result": {
  169. "Blob": "value"
  170. },
  171. "response": {
  172. "status_code": 200,
  173. "headers": {},
  174. "body": "<OperationNameResult><Blob>dmFsdWU=</Blob></OperationNameResult>"
  175. }
  176. }
  177. ]
  178. },
  179. {
  180. "description": "Lists",
  181. "metadata": {
  182. "protocol": "rest-xml"
  183. },
  184. "shapes": {
  185. "OutputShape": {
  186. "type": "structure",
  187. "members": {
  188. "ListMember": {
  189. "shape": "ListShape"
  190. }
  191. }
  192. },
  193. "ListShape": {
  194. "type": "list",
  195. "member": {
  196. "shape": "StringType"
  197. }
  198. },
  199. "StringType": {
  200. "type": "string"
  201. }
  202. },
  203. "cases": [
  204. {
  205. "given": {
  206. "output": {
  207. "shape": "OutputShape"
  208. },
  209. "name": "OperationName"
  210. },
  211. "result": {
  212. "ListMember": ["abc", "123"]
  213. },
  214. "response": {
  215. "status_code": 200,
  216. "headers": {},
  217. "body": "<OperationNameResult><ListMember><member>abc</member><member>123</member></ListMember></OperationNameResult>"
  218. }
  219. }
  220. ]
  221. },
  222. {
  223. "description": "List with custom member name",
  224. "metadata": {
  225. "protocol": "rest-xml"
  226. },
  227. "shapes": {
  228. "OutputShape": {
  229. "type": "structure",
  230. "members": {
  231. "ListMember": {
  232. "shape": "ListShape"
  233. }
  234. }
  235. },
  236. "ListShape": {
  237. "type": "list",
  238. "member": {
  239. "shape": "StringType",
  240. "locationName": "item"
  241. }
  242. },
  243. "StringType": {
  244. "type": "string"
  245. }
  246. },
  247. "cases": [
  248. {
  249. "given": {
  250. "output": {
  251. "shape": "OutputShape"
  252. },
  253. "name": "OperationName"
  254. },
  255. "result": {
  256. "ListMember": ["abc", "123"]
  257. },
  258. "response": {
  259. "status_code": 200,
  260. "headers": {},
  261. "body": "<OperationNameResult><ListMember><item>abc</item><item>123</item></ListMember></OperationNameResult>"
  262. }
  263. }
  264. ]
  265. },
  266. {
  267. "description": "Flattened List",
  268. "metadata": {
  269. "protocol": "rest-xml"
  270. },
  271. "shapes": {
  272. "OutputShape": {
  273. "type": "structure",
  274. "members": {
  275. "ListMember": {
  276. "shape": "StringList",
  277. "flattened": true
  278. }
  279. }
  280. },
  281. "StringList": {
  282. "type": "list",
  283. "member": {
  284. "shape": "StringType"
  285. }
  286. },
  287. "StringType": {
  288. "type": "string"
  289. }
  290. },
  291. "cases": [
  292. {
  293. "given": {
  294. "output": {
  295. "shape": "OutputShape"
  296. },
  297. "name": "OperationName"
  298. },
  299. "result": {
  300. "ListMember": ["abc", "123"]
  301. },
  302. "response": {
  303. "status_code": 200,
  304. "headers": {},
  305. "body": "<OperationNameResult><ListMember>abc</ListMember><ListMember>123</ListMember></OperationNameResult>"
  306. }
  307. }
  308. ]
  309. },
  310. {
  311. "description": "Normal map",
  312. "metadata": {
  313. "protocol": "rest-xml"
  314. },
  315. "shapes": {
  316. "OutputShape": {
  317. "type": "structure",
  318. "members": {
  319. "Map": {
  320. "shape": "StringMap"
  321. }
  322. }
  323. },
  324. "StringMap": {
  325. "type": "map",
  326. "key": {
  327. "shape": "StringType"
  328. },
  329. "value": {
  330. "shape": "SingleStructure"
  331. }
  332. },
  333. "SingleStructure": {
  334. "type": "structure",
  335. "members": {
  336. "foo": {
  337. "shape": "StringType"
  338. }
  339. }
  340. },
  341. "StringType": {
  342. "type": "string"
  343. }
  344. },
  345. "cases": [
  346. {
  347. "given": {
  348. "output": {
  349. "shape": "OutputShape"
  350. },
  351. "name": "OperationName"
  352. },
  353. "result": {
  354. "Map": {
  355. "qux": {
  356. "foo": "bar"
  357. },
  358. "baz": {
  359. "foo": "bam"
  360. }
  361. }
  362. },
  363. "response": {
  364. "status_code": 200,
  365. "headers": {},
  366. "body": "<OperationNameResult><Map><entry><key>qux</key><value><foo>bar</foo></value></entry><entry><key>baz</key><value><foo>bam</foo></value></entry></Map></OperationNameResult>"
  367. }
  368. }
  369. ]
  370. },
  371. {
  372. "description": "Flattened map",
  373. "metadata": {
  374. "protocol": "rest-xml"
  375. },
  376. "shapes": {
  377. "OutputShape": {
  378. "type": "structure",
  379. "members": {
  380. "Map": {
  381. "shape": "StringMap",
  382. "flattened": true
  383. }
  384. }
  385. },
  386. "StringMap": {
  387. "type": "map",
  388. "key": {
  389. "shape": "StringType"
  390. },
  391. "value": {
  392. "shape": "StringType"
  393. }
  394. },
  395. "StringType": {
  396. "type": "string"
  397. }
  398. },
  399. "cases": [
  400. {
  401. "given": {
  402. "output": {
  403. "shape": "OutputShape"
  404. },
  405. "name": "OperationName"
  406. },
  407. "result": {
  408. "Map": {
  409. "qux": "bar",
  410. "baz": "bam"
  411. }
  412. },
  413. "response": {
  414. "status_code": 200,
  415. "headers": {},
  416. "body": "<OperationNameResult><Map><key>qux</key><value>bar</value></Map><Map><key>baz</key><value>bam</value></Map></OperationNameResult>"
  417. }
  418. }
  419. ]
  420. },
  421. {
  422. "description": "Named map",
  423. "metadata": {
  424. "protocol": "rest-xml"
  425. },
  426. "shapes": {
  427. "OutputShape": {
  428. "type": "structure",
  429. "members": {
  430. "Map": {
  431. "shape": "StringMap"
  432. }
  433. }
  434. },
  435. "StringMap": {
  436. "type": "map",
  437. "key": {
  438. "shape": "StringType",
  439. "locationName": "foo"
  440. },
  441. "value": {
  442. "shape": "StringType",
  443. "locationName": "bar"
  444. }
  445. },
  446. "StringType": {
  447. "type": "string"
  448. }
  449. },
  450. "cases": [
  451. {
  452. "given": {
  453. "output": {
  454. "shape": "OutputShape"
  455. },
  456. "name": "OperationName"
  457. },
  458. "result": {
  459. "Map": {
  460. "qux": "bar",
  461. "baz": "bam"
  462. }
  463. },
  464. "response": {
  465. "status_code": 200,
  466. "headers": {},
  467. "body": "<OperationNameResult><Map><entry><foo>qux</foo><bar>bar</bar></entry><entry><foo>baz</foo><bar>bam</bar></entry></Map></OperationNameResult>"
  468. }
  469. }
  470. ]
  471. },
  472. {
  473. "description": "XML payload",
  474. "metadata": {
  475. "protocol": "rest-xml"
  476. },
  477. "shapes": {
  478. "OutputShape": {
  479. "type": "structure",
  480. "payload": "Data",
  481. "members": {
  482. "Header": {
  483. "shape": "StringType",
  484. "location": "header",
  485. "locationName": "X-Foo"
  486. },
  487. "Data": {
  488. "shape": "SingleStructure"
  489. }
  490. }
  491. },
  492. "StringType": {
  493. "type": "string"
  494. },
  495. "SingleStructure": {
  496. "type": "structure",
  497. "members": {
  498. "Foo": {
  499. "shape": "StringType"
  500. }
  501. }
  502. }
  503. },
  504. "cases": [
  505. {
  506. "given": {
  507. "output": {
  508. "shape": "OutputShape"
  509. },
  510. "name": "OperationName"
  511. },
  512. "result": {
  513. "Header": "baz",
  514. "Data": {
  515. "Foo": "abc"
  516. }
  517. },
  518. "response": {
  519. "status_code": 200,
  520. "headers": {
  521. "X-Foo": "baz"
  522. },
  523. "body": "<OperationNameResponse><Foo>abc</Foo></OperationNameResponse>"
  524. }
  525. }
  526. ]
  527. },
  528. {
  529. "description": "Streaming payload",
  530. "metadata": {
  531. "protocol": "rest-xml"
  532. },
  533. "shapes": {
  534. "OutputShape": {
  535. "type": "structure",
  536. "payload": "Stream",
  537. "members": {
  538. "Stream": {
  539. "shape": "BlobStream"
  540. }
  541. }
  542. },
  543. "BlobStream": {
  544. "type": "blob"
  545. }
  546. },
  547. "cases": [
  548. {
  549. "given": {
  550. "output": {
  551. "shape": "OutputShape"
  552. },
  553. "name": "OperationName"
  554. },
  555. "result": {
  556. "Stream": "abc"
  557. },
  558. "response": {
  559. "status_code": 200,
  560. "headers": {},
  561. "body": "abc"
  562. }
  563. }
  564. ]
  565. },
  566. {
  567. "description": "Scalar members in headers",
  568. "metadata": {
  569. "protocol": "rest-xml"
  570. },
  571. "shapes": {
  572. "OutputShape": {
  573. "type": "structure",
  574. "members": {
  575. "Str": {
  576. "locationName": "x-str",
  577. "shape": "StringHeaderType"
  578. },
  579. "Integer": {
  580. "locationName": "x-int",
  581. "shape": "IntegerHeaderType"
  582. },
  583. "TrueBool": {
  584. "locationName": "x-true-bool",
  585. "shape": "BooleanHeaderType"
  586. },
  587. "FalseBool": {
  588. "locationName": "x-false-bool",
  589. "shape": "BooleanHeaderType"
  590. },
  591. "Float": {
  592. "locationName": "x-float",
  593. "shape": "FloatHeaderType"
  594. },
  595. "Double": {
  596. "locationName": "x-double",
  597. "shape": "DoubleHeaderType"
  598. },
  599. "Long": {
  600. "locationName": "x-long",
  601. "shape": "LongHeaderType"
  602. },
  603. "Char": {
  604. "locationName": "x-char",
  605. "shape": "CharHeaderType"
  606. },
  607. "Timestamp": {
  608. "locationName": "x-timestamp",
  609. "shape": "TimestampHeaderType"
  610. }
  611. }
  612. },
  613. "StringHeaderType": {
  614. "location": "header",
  615. "type": "string"
  616. },
  617. "IntegerHeaderType": {
  618. "location": "header",
  619. "type": "integer"
  620. },
  621. "BooleanHeaderType": {
  622. "location": "header",
  623. "type": "boolean"
  624. },
  625. "FloatHeaderType": {
  626. "location": "header",
  627. "type": "float"
  628. },
  629. "DoubleHeaderType": {
  630. "location": "header",
  631. "type": "double"
  632. },
  633. "LongHeaderType": {
  634. "location": "header",
  635. "type": "long"
  636. },
  637. "CharHeaderType": {
  638. "location": "header",
  639. "type": "character"
  640. },
  641. "TimestampHeaderType": {
  642. "location": "header",
  643. "type": "timestamp"
  644. }
  645. },
  646. "cases": [
  647. {
  648. "given": {
  649. "output": {
  650. "shape": "OutputShape"
  651. },
  652. "name": "OperationName"
  653. },
  654. "result": {
  655. "Str": "string",
  656. "Integer": 1,
  657. "TrueBool": true,
  658. "FalseBool": false,
  659. "Float": 1.5,
  660. "Double": 1.5,
  661. "Long": 100,
  662. "Char": "a",
  663. "Timestamp": 1422172800
  664. },
  665. "response": {
  666. "status_code": 200,
  667. "headers": {
  668. "x-str": "string",
  669. "x-int": "1",
  670. "x-true-bool": "true",
  671. "x-false-bool": "false",
  672. "x-float": "1.5",
  673. "x-double": "1.5",
  674. "x-long": "100",
  675. "x-char": "a",
  676. "x-timestamp": "Sun, 25 Jan 2015 08:00:00 GMT"
  677. },
  678. "body": ""
  679. }
  680. }
  681. ]
  682. },
  683. {
  684. "description": "Empty string",
  685. "metadata": {
  686. "protocol": "rest-xml"
  687. },
  688. "shapes": {
  689. "OutputShape": {
  690. "type": "structure",
  691. "members": {
  692. "Foo": {
  693. "shape": "StringType"
  694. }
  695. }
  696. },
  697. "StringType": {
  698. "type": "string"
  699. }
  700. },
  701. "cases": [
  702. {
  703. "given": {
  704. "output": {
  705. "shape": "OutputShape"
  706. },
  707. "name": "OperationName"
  708. },
  709. "result": {
  710. "Foo": ""
  711. },
  712. "response": {
  713. "status_code": 200,
  714. "headers": {},
  715. "body": "<OperationNameResponse><Foo/><RequestId>requestid</RequestId></OperationNameResponse>"
  716. }
  717. }
  718. ]
  719. }
  720. ]