@redocly/openapi-docs 3.12.0-rc.7 → 3.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/dist/redocly-openapi-docs.min.js +2153 -1963
  2. package/lib/components/ApiInfo/ApiInfo.js +29 -1
  3. package/lib/components/ApiInfo/Metadata.js +29 -1
  4. package/lib/components/ApiInfo/index.js +2 -1
  5. package/lib/components/ApiInfo/styled.js +17 -8
  6. package/lib/components/CallbackSamples/CallbackSamples.js +25 -4
  7. package/lib/components/CallbackSamples/index.js +2 -1
  8. package/lib/components/Callbacks/CallbackDetails.js +17 -3
  9. package/lib/components/Callbacks/CallbackOperation.js +24 -3
  10. package/lib/components/Callbacks/CallbackSummary.js +19 -3
  11. package/lib/components/Callbacks/CallbacksList.js +16 -1
  12. package/lib/components/Callbacks/index.js +4 -1
  13. package/lib/components/Callbacks/styled.js +6 -3
  14. package/lib/components/Content/Content.js +10 -1
  15. package/lib/components/Content/index.js +2 -1
  16. package/lib/components/Content/useAutoScroll.js +50 -1
  17. package/lib/components/ContentItem/ContentItem.js +31 -1
  18. package/lib/components/ContentItem/index.js +2 -1
  19. package/lib/components/ContentItem/useIsExpanded.js +33 -1
  20. package/lib/components/ContentItems/ContentItems.js +19 -1
  21. package/lib/components/ContentItems/Items.js +13 -1
  22. package/lib/components/ContentItems/VirtualList.js +35 -1
  23. package/lib/components/ContentItems/helpers.js +49 -1
  24. package/lib/components/ContentItems/index.js +2 -1
  25. package/lib/components/ContentItems/useScrollOnRender.js +26 -1
  26. package/lib/components/Discriminator/Discriminator.js +27 -2
  27. package/lib/components/Discriminator/index.js +2 -1
  28. package/lib/components/Download/DownloadSpecification.js +46 -4
  29. package/lib/components/Download/index.js +2 -1
  30. package/lib/components/Download/types.js +2 -0
  31. package/lib/components/Download/useDownloadInfo.js +42 -1
  32. package/lib/components/ErrorBoundary/ErrorBoundary.js +22 -2
  33. package/lib/components/ErrorBoundary/index.js +2 -1
  34. package/lib/components/ExpandAllButton/ExpandAllButton.js +31 -2
  35. package/lib/components/ExpandAllButton/index.js +2 -1
  36. package/lib/components/ExternalDocumentation/ExternalDocumentation.js +18 -4
  37. package/lib/components/ExternalDocumentation/index.js +2 -1
  38. package/lib/components/Language/LanguageDropdown.js +21 -1
  39. package/lib/components/Language/LanguageItem.js +33 -1
  40. package/lib/components/Language/LanguageList.js +93 -1
  41. package/lib/components/Language/_tests_/LanguageDropdown.test.js +23 -1
  42. package/lib/components/Language/constants.js +3 -1
  43. package/lib/components/Language/index.js +4 -1
  44. package/lib/components/Language/styled.js +29 -15
  45. package/lib/components/Markdown/Markdown.js +64 -1
  46. package/lib/components/Markdown/index.js +3 -1
  47. package/lib/components/Markdown/types.js +2 -0
  48. package/lib/components/MediaTypeSwitch/MediaTypesSwitch.js +51 -1
  49. package/lib/components/MediaTypeSwitch/index.js +2 -1
  50. package/lib/components/OperationItem/Description.d.ts +1 -4
  51. package/lib/components/OperationItem/Description.js +9 -1
  52. package/lib/components/OperationItem/OperationItem.js +70 -5
  53. package/lib/components/OperationItem/_tests_/OperationItem.test.js +70 -1
  54. package/lib/components/OperationItem/_tests_/__mocks__/mock-intersection-observer.js +40 -1
  55. package/lib/components/OperationItem/index.js +2 -1
  56. package/lib/components/OperationItem/types.js +2 -0
  57. package/lib/components/Overlay.js +48 -3
  58. package/lib/components/Overview/Overview.js +20 -1
  59. package/lib/components/Overview/index.js +2 -1
  60. package/lib/components/PageFooter/PageFooter.js +19 -1
  61. package/lib/components/PageFooter/index.js +2 -1
  62. package/lib/components/Panel/ResponsePanel.js +12 -6
  63. package/lib/components/Panel/Trigger.js +4 -2
  64. package/lib/components/Panel/index.js +3 -1
  65. package/lib/components/PanelItem/PanelItem.js +6 -1
  66. package/lib/components/PanelItem/index.js +3 -1
  67. package/lib/components/PanelItem/styled.js +20 -10
  68. package/lib/components/PayloadSamples/Example.js +6 -1
  69. package/lib/components/PayloadSamples/ExampleValue.js +30 -1
  70. package/lib/components/PayloadSamples/MediaTypeSamples.js +36 -2
  71. package/lib/components/PayloadSamples/PayloadSamples.js +26 -1
  72. package/lib/components/PayloadSamples/index.js +7 -1
  73. package/lib/components/PayloadSamples/styled.js +9 -4
  74. package/lib/components/PayloadSamples/types.js +2 -0
  75. package/lib/components/PropertyDetails/DescriptionEnums.js +19 -3
  76. package/lib/components/PropertyDetails/EnumValues.js +37 -1
  77. package/lib/components/PropertyDetails/Examples.js +26 -1
  78. package/lib/components/PropertyDetails/Extensions.js +17 -2
  79. package/lib/components/PropertyDetails/FieldDetail.js +15 -2
  80. package/lib/components/PropertyDetails/FieldDetails.js +51 -6
  81. package/lib/components/PropertyDetails/Pattern.js +21 -1
  82. package/lib/components/PropertyDetails/PlusCircleIcon.js +10 -4
  83. package/lib/components/PropertyDetails/PropertyDetails.js +22 -5
  84. package/lib/components/PropertyDetails/SchemaTypeInfo.js +10 -2
  85. package/lib/components/PropertyDetails/SimpleEnums.js +13 -2
  86. package/lib/components/PropertyDetails/cycleColorsByLevel.js +18 -1
  87. package/lib/components/PropertyDetails/index.js +4 -1
  88. package/lib/components/PropertyDetails/styled.js +15 -7
  89. package/lib/components/PropertyDetails/types.js +2 -0
  90. package/lib/components/RedoclyOpenAPIDocs/Providers.js +114 -1
  91. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocs.js +57 -1
  92. package/lib/components/RedoclyOpenAPIDocs/RedoclyOpenAPIDocsStandalone.js +86 -1
  93. package/lib/components/RedoclyOpenAPIDocs/index.js +5 -1
  94. package/lib/components/RedoclyOpenAPIDocs/styled.js +4 -2
  95. package/lib/components/RedoclyOpenAPIDocs/types.js +2 -0
  96. package/lib/components/RedoclyOpenAPIDocs/utils.js +33 -1
  97. package/lib/components/RenderHook/RenderHook.js +17 -1
  98. package/lib/components/RenderHook/index.js +2 -1
  99. package/lib/components/Replay/EmbeddedReplay.js +41 -3
  100. package/lib/components/Replay/Replay.js +99 -1
  101. package/lib/components/Replay/index.js +3 -1
  102. package/lib/components/Replay/utils.js +208 -1
  103. package/lib/components/Request/RequestDetails.js +33 -2
  104. package/lib/components/Request/types.js +2 -0
  105. package/lib/components/RequestParameters/Body.js +8 -1
  106. package/lib/components/RequestParameters/ParametersGroup.js +19 -4
  107. package/lib/components/RequestParameters/RequestParameters.js +40 -1
  108. package/lib/components/RequestParameters/index.js +4 -1
  109. package/lib/components/RequestSamples/CodeSample.js +55 -2
  110. package/lib/components/RequestSamples/Example.js +37 -1
  111. package/lib/components/RequestSamples/RequestSamples.js +89 -5
  112. package/lib/components/RequestSamples/index.js +3 -1
  113. package/lib/components/RequestSamples/useCodeSamples.js +92 -1
  114. package/lib/components/ResponseSamples/ResponseSamples.js +47 -1
  115. package/lib/components/ResponseSamples/Summary.js +9 -1
  116. package/lib/components/ResponseSamples/index.js +2 -1
  117. package/lib/components/Responses/OperationResponseList.js +42 -2
  118. package/lib/components/Responses/ResponseDetails.js +18 -1
  119. package/lib/components/Responses/ResponseHeaders.js +15 -1
  120. package/lib/components/Responses/index.js +6 -1
  121. package/lib/components/Responses/styled.js +14 -6
  122. package/lib/components/Responses/types.js +2 -0
  123. package/lib/components/RightPanel/RightPanel.js +21 -1
  124. package/lib/components/RightPanel/index.js +2 -1
  125. package/lib/components/Samples/ExampleSwitch.js +33 -1
  126. package/lib/components/Samples/index.js +3 -1
  127. package/lib/components/Samples/use-example-key.js +12 -1
  128. package/lib/components/Schema/ArraySchema.js +45 -1
  129. package/lib/components/Schema/ObjectSchema.js +29 -1
  130. package/lib/components/Schema/OneOfSchema.js +47 -3
  131. package/lib/components/Schema/RecursiveSchema.js +10 -1
  132. package/lib/components/Schema/Schema.js +63 -2
  133. package/lib/components/Schema/SubSchema.js +20 -1
  134. package/lib/components/Schema/helpers.js +16 -1
  135. package/lib/components/Schema/index.js +5 -1
  136. package/lib/components/Schema/types.js +2 -0
  137. package/lib/components/Schema/useOneOfLocationIdx.js +11 -1
  138. package/lib/components/SchemaDefinition/SchemaDefinition.js +65 -2
  139. package/lib/components/SchemaDefinition/index.js +2 -1
  140. package/lib/components/SectionContent/SectionContent.js +49 -6
  141. package/lib/components/SectionContent/index.js +2 -1
  142. package/lib/components/SectionItem/SectionItem.js +14 -1
  143. package/lib/components/SectionItem/index.js +2 -1
  144. package/lib/components/Security/Divider.js +9 -2
  145. package/lib/components/Security/OAuthFlow.js +11 -1
  146. package/lib/components/Security/OAuthScopes.js +59 -9
  147. package/lib/components/Security/Security.js +15 -1
  148. package/lib/components/Security/SecurityButton.js +31 -7
  149. package/lib/components/Security/SecurityFlow.js +28 -4
  150. package/lib/components/Security/SecurityModal.js +34 -5
  151. package/lib/components/Security/SecuritySchemeItem.js +15 -4
  152. package/lib/components/Security/helper.js +16 -1
  153. package/lib/components/Security/index.js +11 -1
  154. package/lib/components/Security/styled.js +6 -3
  155. package/lib/components/SelectOrLabel/SelectOrLabel.js +12 -2
  156. package/lib/components/SelectOrLabel/index.js +2 -1
  157. package/lib/components/ServerList/ServerList.js +36 -10
  158. package/lib/components/ServerList/index.js +2 -1
  159. package/lib/components/ServerList/types.js +2 -0
  160. package/lib/components/ServerListDropdown/ServerListDropdown.js +54 -1
  161. package/lib/components/ServerListDropdown/index.js +2 -1
  162. package/lib/components/ServerListDropdown/styled.js +15 -6
  163. package/lib/components/SideMenu/SideMenu.js +13 -2
  164. package/lib/components/SideMenu/hooks/useMenuItems.js +110 -1
  165. package/lib/components/SideMenu/index.js +2 -1
  166. package/lib/components/SideMenu/types.js +2 -0
  167. package/lib/components/StickySidebar/SidebarActions.js +14 -2
  168. package/lib/components/StickySidebar/StickyResponsiveSidebar.js +37 -7
  169. package/lib/components/StickySidebar/index.js +2 -1
  170. package/lib/components/Tabs/Tabs.js +16 -5
  171. package/lib/components/Tabs/index.js +3 -1
  172. package/lib/components/Tabs/useTabsState.js +22 -1
  173. package/lib/components/TagItem/OperationNavigationItems.js +18 -4
  174. package/lib/components/TagItem/OperationsNavigation.js +46 -2
  175. package/lib/components/TagItem/TagItem.js +41 -8
  176. package/lib/components/TagItem/index.js +2 -1
  177. package/lib/components/TagItem/styled.js +5 -2
  178. package/lib/components/TagItem/types.js +2 -0
  179. package/lib/components/ViewNested/ViewNested.js +42 -9
  180. package/lib/components/ViewNested/index.js +2 -1
  181. package/lib/components/common/Badges.js +21 -5
  182. package/lib/components/common/BodyContent/BodyContent.js +31 -4
  183. package/lib/components/common/BodyContent/index.js +2 -1
  184. package/lib/components/common/ClearButton/ClearButton.js +5 -1
  185. package/lib/components/common/ClearButton/index.js +3 -1
  186. package/lib/components/common/ClearButton/styled.js +5 -2
  187. package/lib/components/common/ClearButton/types.js +2 -0
  188. package/lib/components/common/CodeBlockPanel.js +7 -3
  189. package/lib/components/common/ConstraintsView.js +14 -2
  190. package/lib/components/common/Dropdown/Dropdown.js +22 -4
  191. package/lib/components/common/Dropdown/index.js +2 -1
  192. package/lib/components/common/ExpandableExample/ExpandableExample.js +24 -3
  193. package/lib/components/common/ExpandableExample/index.js +2 -1
  194. package/lib/components/common/Extensions.js +17 -2
  195. package/lib/components/common/Fields/fields-layout.js +76 -51
  196. package/lib/components/common/Fields/fields.js +39 -17
  197. package/lib/components/common/Fields/index.js +3 -1
  198. package/lib/components/common/LinkToField.js +33 -6
  199. package/lib/components/common/OperationItemTitle.d.ts +1 -0
  200. package/lib/components/common/OperationItemTitle.js +16 -5
  201. package/lib/components/common/SchemaSelection/SchemaSelection.js +51 -1
  202. package/lib/components/common/SchemaSelection/index.js +2 -1
  203. package/lib/components/common/Select/Select.js +21 -1
  204. package/lib/components/common/Select/index.js +3 -1
  205. package/lib/components/common/Select/styled.js +17 -9
  206. package/lib/components/common/Select/types.js +2 -0
  207. package/lib/components/common/Skeleton/LanguageListSkeleton.js +16 -6
  208. package/lib/components/common/Skeleton/Skeleton.js +15 -5
  209. package/lib/components/common/Skeleton/index.js +3 -1
  210. package/lib/components/common/headers.js +4 -2
  211. package/lib/components/common/index.js +14 -1
  212. package/lib/components/common/linkify.js +28 -4
  213. package/lib/components/common/mixins.js +4 -2
  214. package/lib/components/common/panels.js +58 -33
  215. package/lib/components/common/schema.js +16 -8
  216. package/lib/components/common/styled.js +15 -7
  217. package/lib/components/index.js +25 -1
  218. package/lib/components/pluggable/RedocExample.js +20 -1
  219. package/lib/components/pluggable/RedocSchema.js +22 -1
  220. package/lib/components/pluggable/index.js +3 -1
  221. package/lib/components/pluggable/styled.components.js +9 -4
  222. package/lib/constants.js +30 -1
  223. package/lib/empty.js +7 -1
  224. package/lib/events/codeSampleCopy.js +19 -1
  225. package/lib/events/creator.js +5 -1
  226. package/lib/events/index.js +8 -1
  227. package/lib/events/languageSwitch.js +18 -1
  228. package/lib/events/panelToggle.js +16 -1
  229. package/lib/events/serverSwitch.js +13 -1
  230. package/lib/events/tryItOpen.js +12 -1
  231. package/lib/events/tryItSent.js +12 -1
  232. package/lib/events/types.js +11 -1
  233. package/lib/hoc/types.js +2 -0
  234. package/lib/hoc/utils.js +4 -1
  235. package/lib/hoc/withRouter.js +17 -1
  236. package/lib/hoc/withStore.js +28 -1
  237. package/lib/hooks/index.js +9 -1
  238. package/lib/hooks/useActivateExample.js +35 -1
  239. package/lib/hooks/useActiveWithFallback.js +12 -1
  240. package/lib/hooks/useContentItems.js +10 -1
  241. package/lib/hooks/useLicense.js +17 -1
  242. package/lib/hooks/usePerformanceMetrics.js +26 -1
  243. package/lib/hooks/useRouter.js +17 -1
  244. package/lib/hooks/useTelemetry.js +5 -1
  245. package/lib/hooks/useTranslate.js +6 -1
  246. package/lib/hooks/useUppercase2LowercaseRedirect.js +12 -1
  247. package/lib/icons/CSharpIcon/CSharpIcon.js +7 -1
  248. package/lib/icons/CSharpIcon/index.js +2 -1
  249. package/lib/icons/CurlIcon/CurlIcon.js +8 -2
  250. package/lib/icons/CurlIcon/index.js +2 -1
  251. package/lib/icons/GOIcon/GOIcon.js +7 -1
  252. package/lib/icons/GOIcon/index.js +2 -1
  253. package/lib/icons/JavaIcon/JavaIcon.js +7 -1
  254. package/lib/icons/JavaIcon/index.js +2 -1
  255. package/lib/icons/JavaScriptIcon/JavaScriptIcon.js +7 -1
  256. package/lib/icons/JavaScriptIcon/index.js +2 -1
  257. package/lib/icons/NodeJSIcon/NodeJSIcon.js +7 -1
  258. package/lib/icons/NodeJSIcon/index.js +2 -1
  259. package/lib/icons/PHPIcon/PHPIcon.js +7 -1
  260. package/lib/icons/PHPIcon/index.js +2 -1
  261. package/lib/icons/PayloadIcon/PayloadIcon.js +7 -1
  262. package/lib/icons/PayloadIcon/index.js +2 -1
  263. package/lib/icons/PythonIcon/PythonIcon.js +7 -1
  264. package/lib/icons/PythonIcon/index.js +2 -1
  265. package/lib/icons/RIcon/RIcon.js +7 -1
  266. package/lib/icons/RIcon/index.js +2 -1
  267. package/lib/icons/RubyIcon/RubyIcon.js +7 -1
  268. package/lib/icons/RubyIcon/index.js +2 -1
  269. package/lib/index.js +49 -1
  270. package/lib/jotai/app.js +113 -1
  271. package/lib/jotai/operation.js +28 -1
  272. package/lib/jotai/replay.js +5 -1
  273. package/lib/jotai/store.js +8 -1
  274. package/lib/jotai/use-write-atom.js +9 -1
  275. package/lib/models/callback.js +28 -1
  276. package/lib/models/code-sample-options.js +2 -0
  277. package/lib/models/example.js +17 -1
  278. package/lib/models/field.js +109 -1
  279. package/lib/models/group.js +38 -1
  280. package/lib/models/index.js +14 -1
  281. package/lib/models/mediaContent.js +26 -1
  282. package/lib/models/mediaType.js +153 -1
  283. package/lib/models/operation.js +166 -1
  284. package/lib/models/request.js +25 -1
  285. package/lib/models/response.js +46 -1
  286. package/lib/models/schema.js +474 -2
  287. package/lib/models/security.js +84 -1
  288. package/lib/models/tab.js +2 -0
  289. package/lib/models/types.js +2 -0
  290. package/lib/services/OpenAPIParser.js +321 -1
  291. package/lib/services/check.js +104 -1
  292. package/lib/services/code-samples/constants.js +16 -1
  293. package/lib/services/code-samples/generator.js +540 -1
  294. package/lib/services/code-samples/httpsnippet/helpers/code-builder.d.ts +5 -1
  295. package/lib/services/code-samples/httpsnippet/helpers/code-builder.js +252 -3
  296. package/lib/services/code-samples/httpsnippet/helpers/code-helpers.d.ts +2 -2
  297. package/lib/services/code-samples/httpsnippet/helpers/code-helpers.js +90 -2
  298. package/lib/services/code-samples/httpsnippet/helpers/constants.js +28 -1
  299. package/lib/services/code-samples/httpsnippet/helpers/lodash-int.js +173 -1
  300. package/lib/services/code-samples/httpsnippet/helpers/mocks/code-helpers-mock.js +76 -37
  301. package/lib/services/code-samples/httpsnippet/helpers/reducer.js +16 -1
  302. package/lib/services/code-samples/httpsnippet/helpers/shell.js +20 -1
  303. package/lib/services/code-samples/httpsnippet/helpers/string-utility.js +19 -1
  304. package/lib/services/code-samples/httpsnippet/index.js +166 -1
  305. package/lib/services/code-samples/httpsnippet/targets/__mocks__/mock.js +2340 -146
  306. package/lib/services/code-samples/httpsnippet/targets/csharp/httpclient.js +227 -2
  307. package/lib/services/code-samples/httpsnippet/targets/csharp/index.js +11 -1
  308. package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/httpclient.js +185 -2
  309. package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/index.js +11 -1
  310. package/lib/services/code-samples/httpsnippet/targets/go/index.js +11 -1
  311. package/lib/services/code-samples/httpsnippet/targets/go/native.js +222 -3
  312. package/lib/services/code-samples/httpsnippet/targets/index.js +28 -1
  313. package/lib/services/code-samples/httpsnippet/targets/java/httpclient.js +184 -3
  314. package/lib/services/code-samples/httpsnippet/targets/java/index.js +11 -1
  315. package/lib/services/code-samples/httpsnippet/targets/java8/apachehttp.js +223 -2
  316. package/lib/services/code-samples/httpsnippet/targets/java8/index.js +11 -1
  317. package/lib/services/code-samples/httpsnippet/targets/javascript/fetch.js +147 -1
  318. package/lib/services/code-samples/httpsnippet/targets/javascript/index.js +11 -1
  319. package/lib/services/code-samples/httpsnippet/targets/node/fetch.js +199 -1
  320. package/lib/services/code-samples/httpsnippet/targets/node/index.js +11 -1
  321. package/lib/services/code-samples/httpsnippet/targets/php/curl.js +203 -5
  322. package/lib/services/code-samples/httpsnippet/targets/php/index.js +11 -1
  323. package/lib/services/code-samples/httpsnippet/targets/php/types.js +2 -0
  324. package/lib/services/code-samples/httpsnippet/targets/php/utils.js +106 -5
  325. package/lib/services/code-samples/httpsnippet/targets/python/index.js +11 -1
  326. package/lib/services/code-samples/httpsnippet/targets/python/requests.js +185 -6
  327. package/lib/services/code-samples/httpsnippet/targets/r/httr.js +111 -1
  328. package/lib/services/code-samples/httpsnippet/targets/r/index.js +11 -1
  329. package/lib/services/code-samples/httpsnippet/targets/r/utils.js +18 -6
  330. package/lib/services/code-samples/httpsnippet/targets/ruby/index.js +11 -1
  331. package/lib/services/code-samples/httpsnippet/targets/ruby/native.js +169 -1
  332. package/lib/services/code-samples/httpsnippet/targets/shell/curl.js +94 -6
  333. package/lib/services/code-samples/httpsnippet/targets/shell/index.js +11 -1
  334. package/lib/services/code-samples/index.js +3 -1
  335. package/lib/services/code-samples/types.js +2 -0
  336. package/lib/services/config-options/helpers.js +49 -1
  337. package/lib/services/config-options/index.js +3 -1
  338. package/lib/services/config-options/normalizeOptions.js +83 -1
  339. package/lib/services/config-options/types.js +2 -0
  340. package/lib/services/history/helpers.js +63 -1
  341. package/lib/services/history/index.js +2 -1
  342. package/lib/services/index.js +9 -1
  343. package/lib/services/menu/builder.js +47 -1
  344. package/lib/services/menu/index.js +2 -1
  345. package/lib/services/menu/markdown.js +93 -1
  346. package/lib/services/menu/operation.js +50 -1
  347. package/lib/services/menu/tags.js +166 -1
  348. package/lib/services/types.d.ts +0 -3
  349. package/lib/services/types.js +2 -0
  350. package/lib/services/utils.js +83 -1
  351. package/lib/standalone.js +68 -1
  352. package/lib/styled-components.js +6 -1
  353. package/lib/types/app.js +2 -0
  354. package/lib/types/index.js +4 -1
  355. package/lib/types/open-api.d.ts +1 -0
  356. package/lib/types/open-api.js +2 -0
  357. package/lib/types/security.js +2 -0
  358. package/lib/utils/JsonPointer.js +84 -1
  359. package/lib/utils/areArraysEqual.js +4 -1
  360. package/lib/utils/argValuesHelpers.js +35 -1
  361. package/lib/utils/compose.js +2 -1
  362. package/lib/utils/configure-helpers.js +223 -1
  363. package/lib/utils/convertSwagger2OpenAPI.js +14 -1
  364. package/lib/utils/cookies.js +73 -1
  365. package/lib/utils/debounce.js +22 -1
  366. package/lib/utils/debug.js +11 -1
  367. package/lib/utils/dom.js +65 -1
  368. package/lib/utils/environments.js +13 -1
  369. package/lib/utils/helpers.js +222 -12
  370. package/lib/utils/index.js +25 -1
  371. package/lib/utils/isMobile.js +13 -1
  372. package/lib/utils/loadAndBundleSpec.js +32 -1
  373. package/lib/utils/local-storage.js +12 -1
  374. package/lib/utils/object.js +31 -1
  375. package/lib/utils/openapi.js +592 -1
  376. package/lib/utils/parameters.js +13 -1
  377. package/lib/utils/path.js +22 -1
  378. package/lib/utils/queryString.js +60 -1
  379. package/lib/utils/replaceVariables.js +14 -1
  380. package/lib/utils/saveTextBeforeHeading.js +35 -1
  381. package/lib/utils/security-details.js +49 -1
  382. package/lib/utils/session-storage.js +12 -1
  383. package/lib/utils/simplifyAstStructure.js +22 -1
  384. package/lib/utils/sort.js +21 -1
  385. package/lib/utils/string.js +65 -1
  386. package/lib/utils/telemetry.js +7 -1
  387. package/lib/utils/test-utils.js +26 -1
  388. package/lib/utils/theme-helpers.js +24 -3
  389. package/lib/utils/url.js +38 -1
  390. package/package.json +5 -5
@@ -1,146 +1,2340 @@
1
- const e={openapi:"3.0.0",servers:[{url:"//petstore.swagger.io/v2",description:"Default server"},{url:"//petstore.swagger.io/sandbox",description:"Sandbox server"}],info:{description:`This is a sample server Petstore server.
2
- You can find out more about Swagger at
3
- [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).
4
- For this sample, you can use the api key \`special-key\` to test the authorization filters.
5
-
6
- # Introduction
7
- This API is documented in **OpenAPI format** and is based on
8
- [Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.
9
- It was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)
10
- tool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard
11
- OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).
12
-
13
- # OpenAPI Specification
14
- This API is documented in **OpenAPI format** and is based on
15
- [Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.
16
- It was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)
17
- tool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard
18
- OpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).
19
-
20
- ## Subheader 1
21
-
22
- Consectetur adipiscing elit. Etiam fringilla tincidunt magna non dignissim. Vestibulum vestibulum ipsum augue, sed rhoncus diam consequat sodales. Sed facilisis maximus enim, ut scelerisque lorem ullamcorper eget. Suspendisse venenatis non lectus sed bibendum.
23
- *Duis neque ante, ultrices at ornare aliquam, vulputate ac dolor.*
24
-
25
- ## Subheader 2
26
-
27
- Lorem ipsum dolor sit amet. Ut tempor sem vitae dui varius, consequat varius ligula fringilla. Nulla accumsan pellentesque lorem eu pharetra. Duis vel est metus. Nulla id quam eget ante egestas fringilla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur vulputate pulvinar turpis, ac convallis quam.
28
-
29
- # Cross-Origin Resource Sharing
30
- This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/).
31
- And that allows cross-domain communication from the browser.
32
- All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
33
-
34
- # Authentication
35
-
36
- Petstore offers two forms of authentication:
37
- - API Key
38
- - OAuth2
39
- OAuth2 - an open protocol to allow secure authorization in a simple
40
- and standard method from web, mobile and desktop applications.
41
- `,version:"1.0.0",title:"Swagger Petstore",termsOfService:"http://swagger.io/terms/",contact:{name:"API Support",email:"apiteam@swagger.io",url:"https://github.com/Redocly/redoc"},"x-logo":{url:"https://redocly.github.io/redoc/petstore-logo.png",altText:"Petstore logo"},license:{name:"Apache 2.0",url:"http://www.apache.org/licenses/LICENSE-2.0.html"}},externalDocs:{description:"Find out how to create Github repo for your OpenAPI spec.",url:"https://github.com/Rebilly/generator-openapi-repo"},tags:[{name:"pet",description:`Lorem ipsum dolor sit amet.
42
-
43
- **Consectetur** adipiscing elit. Etiam fringilla tincidunt magna non dignissim. Vestibulum vestibulum ipsum augue, sed rhoncus diam consequat sodales. Sed facilisis maximus enim, ut scelerisque lorem ullamcorper eget. Suspendisse venenatis non lectus sed bibendum.
44
- *Duis neque ante, ultrices at ornare aliquam, vulputate ac dolor.*
45
-
46
- Pellentesque nulla lorem:
47
- - dapibus lacinia magna vitae,
48
- - eleifend bibendum nisi
49
-
50
- Nullam pretium erat ut augue mollis, id varius orci pretium.
51
- > Ut efficitur eget dui eget molestie.
52
-
53
- Ut tempor sem vitae dui varius, consequat varius ligula fringilla. Nulla accumsan pellentesque lorem eu pharetra. Duis vel est metus. Nulla id quam eget ante egestas fringilla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur vulputate pulvinar turpis, ac convallis quam.
54
- [More info](http://swagger.io)
55
- `},{name:"store"},{name:"user",description:`Operations about user
56
-
57
- ## Custom section 1
58
- Nullam pretium erat ut augue mollis, id varius orci pretium.
59
-
60
-
61
- ## Custom section 2
62
- Nulla accumsan pellentesque lorem eu pharetra. Duis vel est metus. Nulla id quam eget ante egestas fringilla. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
63
-
64
- Some Item
65
- `},{name:"pet_model","x-displayName":"The Pet Model",description:`<SchemaDefinition schemaRef="#/components/schemas/Pet" />
66
- `},{name:"store_model","x-displayName":"The Order Model",description:`<SchemaDefinition schemaRef="#/components/schemas/Order" exampleRef="#/components/examples/Order" showReadOnly={true} showWriteOnly={true} />
67
- `}],"x-tagGroups":[{name:"General",tags:["pet","store"]},{name:"User Management",tags:["user"]},{name:"Models",tags:["pet_model","store_model"]}],paths:{"/pet":{parameters:[{name:"Accept-Language",in:"header",description:"The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US",example:"en-US",required:!1,schema:{type:"string",default:"en-AU"}},{name:"cookieParam",in:"cookie",description:"Some cookie",required:!0,schema:{type:"integer",format:"int64"}}],post:{tags:["pet"],summary:"Add a new pet to the store",description:"Add new pet to the store inventory.",operationId:"addPet",responses:{405:{description:"Invalid input"}},security:[{petstore_auth:["write:pets","read:pets"]}],"x-codeSamples":[{lang:"C#",source:`PetStore.v1.Pet pet = new PetStore.v1.Pet();
68
- pet.setApiKey("your api key");
69
- pet.petType = PetStore.v1.Pet.TYPE_DOG;
70
- pet.name = "Rex";
71
- // set other fields
72
- PetStoreResponse response = pet.create();
73
- if (response.statusCode == HttpStatusCode.Created)
74
- {
75
- // Successfully created
76
- }
77
- else
78
- {
79
- // Something wrong -- check response for errors
80
- Console.WriteLine(response.getRawResponse());
81
- }
82
- `},{lang:"PHP",source:`$form = new \\PetStore\\Entities\\Pet();
83
- $form->setPetType("Dog");
84
- $form->setName("Rex");
85
- // set other fields
86
- try {
87
- $pet = $client->pets()->create($form);
88
- } catch (UnprocessableEntityException $e) {
89
- var_dump($e->getErrors());
90
- }
91
- `}],requestBody:{$ref:"#/components/requestBodies/Pet"}},put:{tags:["pet"],summary:"Update an existing pet",description:"",operationId:"updatePet",responses:{400:{description:"Invalid ID supplied"},404:{description:"Pet not found"},405:{description:"Validation exception"}},security:[{petstore_auth:["write:pets","read:pets"]}],"x-codeSamples":[{lang:"PHP",source:`$form = new \\PetStore\\Entities\\Pet();
92
- $form->setPetId(1);
93
- $form->setPetType("Dog");
94
- $form->setName("Rex");
95
- // set other fields
96
- try {
97
- $pet = $client->pets()->update($form);
98
- } catch (UnprocessableEntityException $e) {
99
- var_dump($e->getErrors());
100
- }
101
- `}],requestBody:{$ref:"#/components/requestBodies/Pet"}}},"/pet/{petId}":{get:{tags:["pet"],summary:"Find pet by ID",description:"Returns a single pet",operationId:"getPetById",parameters:[{name:"petId",in:"path",description:"ID of pet to return",required:!0,deprecated:!0,schema:{type:"integer",format:"int64"}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}},"application/xml":{schema:{$ref:"#/components/schemas/Pet"}}}},400:{description:"Invalid ID supplied"},404:{description:"Pet not found"}},security:[{api_key:[]}]},post:{tags:["pet"],summary:"Updates a pet in the store with form data",description:"",operationId:"updatePetWithForm",parameters:[{name:"petId",in:"path",description:"ID of pet that needs to be updated",required:!0,schema:{type:"integer",format:"int64"}}],responses:{405:{description:"Invalid input"}},security:[{petstore_auth:["write:pets","read:pets"]}],requestBody:{content:{"application/x-www-form-urlencoded":{schema:{type:"object",properties:{name:{description:"Updated name of the pet",type:"string"},status:{description:"Updated status of the pet",type:"string"}}}}}}},delete:{tags:["pet"],summary:"Deletes a pet",description:"",operationId:"deletePet",parameters:[{name:"api_key",in:"header",required:!1,schema:{type:"string"},example:"Bearer <TOKEN>"},{name:"petId",in:"path",description:"Pet id to delete",required:!0,schema:{type:"integer",format:"int64"}}],responses:{400:{description:"Invalid pet value"}},security:[{petstore_auth:["write:pets","read:pets"]}]}},"/pet/{petId}/uploadImage":{post:{tags:["pet"],summary:"uploads an image",description:"",operationId:"uploadFile",parameters:[{name:"petId",in:"path",description:"ID of pet to update",required:!0,schema:{type:"integer",format:"int64"}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/ApiResponse"}}}}},security:[{petstore_auth:["write:pets","read:pets"]}],requestBody:{content:{"application/octet-stream":{schema:{type:"string",format:"binary"}}}}}},"/pet/{petId}/uploadImage/{data}":{post:{tags:["pet"],summary:"uploads an image",description:"",operationId:"uploadFile",parameters:[{name:"petId",in:"path",description:"ID of pet to update",required:!0,schema:{type:"integer",format:"int64"}},{name:"data",in:"path",description:"ID of pet to update",required:!0,schema:{type:"integer",format:"int64"}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/ApiResponse"}}}}},security:[{petstore_auth:["write:pets","read:pets"]}],requestBody:{content:{"application/octet-stream":{schema:{type:"string",format:"binary"}}}}}},"/pet/findByStatus":{get:{tags:["pet"],summary:"Finds Pets by status",description:"Multiple status values can be provided with comma separated strings",operationId:"findPetsByStatus",parameters:[{name:"status",in:"query",description:"Status values that need to be considered for filter",required:!0,style:"form",schema:{type:"array",minItems:1,maxItems:3,items:{type:"string",enum:["available","pending","sold"],default:"available"}}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/Pet"}}},"application/xml":{schema:{type:"array",items:{$ref:"#/components/schemas/Pet"}}}}},400:{description:"Invalid status value"}},security:[{petstore_auth:["write:pets","read:pets"]}]}},"/pet/findByTags":{get:{tags:["pet"],summary:"Finds Pets by tags",description:"Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.",operationId:"findPetsByTags",deprecated:!0,parameters:[{name:"tags",in:"query",description:"Tags to filter by",required:!0,style:"form",schema:{type:"array",items:{type:"string"}}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/Pet"}}},"application/xml":{schema:{type:"array",items:{$ref:"#/components/schemas/Pet"}}}}},400:{description:"Invalid tag value"}},security:[{petstore_auth:["write:pets","read:pets"]}]}},"/store/inventory":{get:{tags:["store"],summary:"Returns pet inventories by status",description:"Returns a map of status codes to quantities",operationId:"getInventory",responses:{200:{description:"successful operation",content:{"application/json":{schema:{type:"object",additionalProperties:{type:"integer",format:"int32"}}}}}},security:[{api_key:[]}]}},"/store/order":{post:{tags:["store"],summary:"Place an order for a pet",description:"",operationId:"placeOrder",responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/Order"}},"application/xml":{schema:{$ref:"#/components/schemas/Order"}}}},400:{description:"Invalid Order",content:{"application/json":{example:{status:400,message:"Invalid Order"}}}}},requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/Order"}}},description:"order placed for purchasing the pet",required:!0}}},"/store/order/{orderId}":{get:{tags:["store"],summary:"Find purchase order by ID",description:"For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions",operationId:"getOrderById",parameters:[{name:"orderId",in:"path",description:"ID of pet that needs to be fetched",required:!0,schema:{type:"integer",format:"int64",minimum:1,maximum:5}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/Order"}},"application/xml":{schema:{$ref:"#/components/schemas/Order"}}}},400:{description:"Invalid ID supplied"},404:{description:"Order not found"}}},delete:{tags:["store"],summary:"Delete purchase order by ID",description:"For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors",operationId:"deleteOrder",parameters:[{name:"orderId",in:"path",description:"ID of the order that needs to be deleted",required:!0,schema:{type:"string",minimum:1}}],responses:{400:{description:"Invalid ID supplied"},404:{description:"Order not found"}}}},"/store/subscribe":{post:{tags:["store"],summary:"Subscribe to the Store events",description:"Add subscription for a store events",requestBody:{content:{"application/json":{schema:{type:"object",properties:{callbackUrl:{type:"string",format:"uri",description:"This URL will be called by the server when the desired event will occur",example:"https://myserver.com/send/callback/here"},eventName:{type:"string",description:"Event name for the subscription",enum:["orderInProgress","orderShipped","orderDelivered"],example:"orderInProgress"}},required:["callbackUrl","eventName"]}}}},responses:{201:{description:"Subscription added",content:{"application/json":{schema:{type:"object",properties:{subscriptionId:{type:"string",example:"AAA-123-BBB-456"}}}}}}},callbacks:{orderInProgress:{"{$request.body#/callbackUrl}?event={$request.body#/eventName}":{servers:[{url:"//callback-url.path-level/v1",description:"Path level server 1"},{url:"//callback-url.path-level/v2",description:"Path level server 2"}],post:{summary:"Order in Progress (Summary)",description:'A callback triggered every time an Order is updated status to "inProgress" (Description)',externalDocs:{description:"Find out more",url:"https://more-details.com/demo"},requestBody:{content:{"application/json":{schema:{type:"object",properties:{orderId:{type:"string",example:"123"},timestamp:{type:"string",format:"date-time",example:"2018-10-19T16:46:45Z"},status:{type:"string",example:"inProgress"}}}},"application/xml":{schema:{type:"object",properties:{orderId:{type:"string",example:"123"}}},example:`<?xml version="1.0" encoding="UTF-8"?>
102
- <root>
103
- <orderId>123</orderId>
104
- <status>inProgress</status>
105
- <timestamp>2018-10-19T16:46:45Z</timestamp>
106
- </root>
107
- `}}},responses:{200:{description:"Callback successfully processed and no retries will be performed",content:{"application/json":{schema:{type:"object",properties:{someProp:{type:"string",example:"123"}}}}}},299:{description:"Response for cancelling subscription"},500:{description:"Callback processing failed and retries will be performed"}},"x-codeSamples":[{lang:"C#",source:`PetStore.v1.Pet pet = new PetStore.v1.Pet();
108
- pet.setApiKey("your api key");
109
- pet.petType = PetStore.v1.Pet.TYPE_DOG;
110
- pet.name = "Rex";
111
- // set other fields
112
- PetStoreResponse response = pet.create();
113
- if (response.statusCode == HttpStatusCode.Created)
114
- {
115
- // Successfully created
116
- }
117
- else
118
- {
119
- // Something wrong -- check response for errors
120
- Console.WriteLine(response.getRawResponse());
121
- }
122
- `},{lang:"PHP",source:`$form = new \\PetStore\\Entities\\Pet();
123
- $form->setPetType("Dog");
124
- $form->setName("Rex");
125
- // set other fields
126
- try {
127
- $pet = $client->pets()->create($form);
128
- } catch (UnprocessableEntityException $e) {
129
- var_dump($e->getErrors());
130
- }
131
- `}]},put:{description:"Order in Progress (Only Description)",servers:[{url:"//callback-url.operation-level/v1",description:"Operation level server 1 (Operation override)"},{url:"//callback-url.operation-level/v2",description:"Operation level server 2 (Operation override)"}],requestBody:{content:{"application/json":{schema:{type:"object",properties:{orderId:{type:"string",example:"123"},timestamp:{type:"string",format:"date-time",example:"2018-10-19T16:46:45Z"},status:{type:"string",example:"inProgress"}}}},"application/xml":{schema:{type:"object",properties:{orderId:{type:"string",example:"123"}}},example:`<?xml version="1.0" encoding="UTF-8"?>
132
- <root>
133
- <orderId>123</orderId>
134
- <status>inProgress</status>
135
- <timestamp>2018-10-19T16:46:45Z</timestamp>
136
- </root>
137
- `}}},responses:{200:{description:"Callback successfully processed and no retries will be performed",content:{"application/json":{schema:{type:"object",properties:{someProp:{type:"string",example:"123"}}}}}}}}}},orderShipped:{"{$request.body#/callbackUrl}?event={$request.body#/eventName}":{post:{description:`Very long description
138
- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
139
- incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
140
- nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
141
- Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
142
- fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
143
- culpa qui officia deserunt mollit anim id est laborum.
144
- `,requestBody:{content:{"application/json":{schema:{type:"object",properties:{orderId:{type:"string",example:"123"},timestamp:{type:"string",format:"date-time",example:"2018-10-19T16:46:45Z"},estimatedDeliveryDate:{type:"string",format:"date-time",example:"2018-11-11T16:00:00Z"}}}}}},responses:{200:{description:"Callback successfully processed and no retries will be performed"}}}}},orderDelivered:{"http://notificationServer.com?url={$request.body#/callbackUrl}&event={$request.body#/eventName}":{post:{deprecated:!0,summary:"Order delivered",description:"A callback triggered every time an Order is delivered to the recipient",requestBody:{content:{"application/json":{schema:{type:"object",properties:{orderId:{type:"string",example:"123"},timestamp:{type:"string",format:"date-time",example:"2018-10-19T16:46:45Z"}}}}}},responses:{200:{description:"Callback successfully processed and no retries will be performed"}}}}}}}},"/user":{post:{tags:["user"],summary:"Create user",description:"This can only be done by the logged in user.",operationId:"createUser",responses:{default:{description:"successful operation"}},requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/User"}}},description:"Created user object",required:!0}}},"/user/{username}":{get:{tags:["user"],summary:"Get user by user name",description:"",operationId:"getUserByName",parameters:[{name:"username",in:"path",description:"The name that needs to be fetched. Use user1 for testing. ",required:!0,schema:{type:"string"}}],responses:{200:{description:"successful operation",content:{"application/json":{schema:{$ref:"#/components/schemas/User"}},"application/xml":{schema:{$ref:"#/components/schemas/User"}}}},400:{description:"Invalid username supplied"},404:{description:"User not found"}}},put:{tags:["user"],summary:"Updated user",description:"This can only be done by the logged in user.",operationId:"updateUser",parameters:[{name:"username",in:"path",description:"name that need to be deleted",required:!0,schema:{type:"string"}}],responses:{400:{description:"Invalid user supplied"},404:{description:"User not found"}},requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/User"}}},description:"Updated user object",required:!0}},delete:{tags:["user"],summary:"Delete user",description:"This can only be done by the logged in user.",operationId:"deleteUser",parameters:[{name:"username",in:"path",description:"The name that needs to be deleted",required:!0,schema:{type:"string"}}],responses:{400:{description:"Invalid username supplied"},404:{description:"User not found"}}}},"/user/createWithArray":{post:{tags:["user"],summary:"Creates list of users with given input array",description:"",operationId:"createUsersWithArrayInput",responses:{default:{description:"successful operation"}},requestBody:{$ref:"#/components/requestBodies/UserArray"}}},"/user/createWithList":{post:{tags:["user"],summary:"Creates list of users with given input array",description:"",operationId:"createUsersWithListInput",responses:{default:{description:"successful operation"}},requestBody:{$ref:"#/components/requestBodies/UserArray"}}},"/user/login":{get:{tags:["user"],summary:"Logs user into the system",description:"",operationId:"loginUser",parameters:[{name:"username",in:"query",description:"The user name for login",required:!0,schema:{type:"string"}},{name:"password",in:"query",description:"The password for login in clear text",required:!0,schema:{type:"string"}}],responses:{200:{description:"successful operation",headers:{"X-Rate-Limit":{description:"calls per hour allowed by the user",schema:{type:"integer",format:"int32"}},"X-Expires-After":{description:"date in UTC when token expires",schema:{type:"string",format:"date-time"}}},content:{"application/json":{schema:{type:"string"},examples:{response:{value:"OK"}}},"application/xml":{schema:{type:"string"},examples:{response:{value:"<Message> OK </Message>"}}},"text/plain":{examples:{response:{value:"OK"}}}}},400:{description:"Invalid username/password supplied"}}}},"/user/logout":{get:{tags:["user"],summary:"Logs out current logged in user session",description:"",operationId:"logoutUser",responses:{default:{description:"successful operation"}}}}},components:{schemas:{ApiResponse:{type:"object",properties:{code:{type:"integer",format:"int32"},type:{type:"string"},message:{type:"string"}}},Cat:{description:"A representation of a cat",allOf:[{$ref:"#/components/schemas/Pet"},{type:"object",properties:{huntingSkill:{type:"string",description:"The measured skill for hunting",default:"lazy",example:"adventurous",enum:["clueless","lazy","adventurous","aggressive"]}},required:["huntingSkill"]}]},Category:{type:"object",properties:{id:{description:"Category ID",allOf:[{$ref:"#/components/schemas/Id"}]},name:{description:"Category name",type:"string",minLength:1},sub:{description:"Test Sub Category",type:"object",properties:{prop1:{type:"string",description:"Dumb Property"}}}},xml:{name:"Category"}},Dog:{description:"A representation of a dog",allOf:[{$ref:"#/components/schemas/Pet"},{type:"object",properties:{packSize:{type:"integer",format:"int32",description:"The size of the pack the dog is from",default:1,minimum:1}},required:["packSize"]}]},HoneyBee:{description:"A representation of a honey bee",allOf:[{$ref:"#/components/schemas/Pet"},{type:"object",properties:{honeyPerDay:{type:"number",description:"Average amount of honey produced per day in ounces",example:3.14,multipleOf:.01}},required:["honeyPerDay"]}]},Id:{type:"integer",format:"int64",readOnly:!0},Order:{type:"object",properties:{id:{description:"Order ID",allOf:[{$ref:"#/components/schemas/Id"}]},petId:{description:"Pet ID",allOf:[{$ref:"#/components/schemas/Id"}]},quantity:{type:"integer",format:"int32",minimum:1,default:1},shipDate:{description:"Estimated ship date",type:"string",format:"date-time"},status:{type:"string",description:"Order Status",enum:["placed","approved","delivered"]},complete:{description:"Indicates whenever order was completed or not",type:"boolean",default:!1,readOnly:!0},requestId:{description:"Unique Request Id",type:"string",writeOnly:!0}},xml:{name:"Order"}},Pet:{type:"object",required:["name","photoUrls"],discriminator:{propertyName:"petType",mapping:{cat:"#/components/schemas/Cat",dog:"#/components/schemas/Dog",bee:"#/components/schemas/HoneyBee"}},properties:{id:{externalDocs:{description:"Find more info here",url:"https://example.com"},description:"Pet ID",allOf:[{$ref:"#/components/schemas/Id"}]},category:{description:"Categories this pet belongs to",allOf:[{$ref:"#/components/schemas/Category"}]},name:{description:"The name given to a pet",type:"string",example:"Guru"},photoUrls:{description:"The list of URL to a cute photos featuring pet",type:"array",maxItems:20,xml:{name:"photoUrl",wrapped:!0},items:{type:"string",format:"url"}},friend:{allOf:[{$ref:"#/components/schemas/Pet"}]},tags:{description:"Tags attached to the pet",type:"array",minItems:1,xml:{name:"tag",wrapped:!0},items:{$ref:"#/components/schemas/Tag"}},status:{type:"string",description:"Pet status in the store",enum:["available","pending","sold"]},petType:{description:"Type of a pet",type:"string"}},xml:{name:"Pet"}},Tag:{type:"object",properties:{id:{description:"Tag ID",allOf:[{$ref:"#/components/schemas/Id"}]},name:{description:"Tag name",type:"string",minLength:1}},xml:{name:"Tag"}},User:{type:"object",properties:{id:{$ref:"#/components/schemas/Id"},pet:{oneOf:[{$ref:"#/components/schemas/Pet"},{$ref:"#/components/schemas/Tag"}]},username:{description:"User supplied username",type:"string",minLength:4,example:"John78"},firstName:{description:"User first name",type:"string",minLength:1,example:"John"},lastName:{description:"User last name",type:"string",minLength:1,example:"Smith"},email:{description:"User email address",type:"string",format:"email",example:"john.smith@example.com"},password:{type:"string",description:"User password, MUST contain a mix of upper and lower case letters, as well as digits",format:"password",minLength:8,pattern:"/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/",example:"drowssaP123"},phone:{description:"User phone number in international format",type:"string",pattern:"/^\\+(?:[0-9]-?){6,14}[0-9]$/",example:"+1-202-555-0192"},userStatus:{description:"User status",type:"integer",format:"int32"}},xml:{name:"User"}}},requestBodies:{Pet:{content:{"application/json":{schema:{allOf:[{description:"My Pet",title:"Pettie"},{$ref:"#/components/schemas/Pet"}]}},"application/xml":{schema:{type:"object",properties:{name:{type:"string",description:"hooray"}}}}},description:"Pet object that needs to be added to the store",required:!0},UserArray:{content:{"application/json":{schema:{type:"array",items:{$ref:"#/components/schemas/User"}}}},description:"List of user object",required:!0}},securitySchemes:{petstore_auth:{description:`Get access to data while protecting your account credentials.
145
- OAuth2 is also a safer and more secure way to give you access.
146
- `,type:"oauth2",flows:{clientCredentials:{tokenUrl:"http://petstore.swagger.io/api/oauth/dialog",scopes:{"write:pets":"modify pets in your account","read:pets":"read your pets"}}}},api_key:{description:"For this sample, you can use the api key `special-key` to test the authorization filters.\n",type:"apiKey",name:"api_key",in:"header"}},examples:{Order:{value:{quantity:1,shipDate:"2018-10-19T16:46:45Z",status:"placed",complete:!1}}}},"x-webhooks":{newPet:{post:{summary:"New pet",description:"Information about a new pet in the systems",operationId:"newPet",tags:["pet"],requestBody:{content:{"application/json":{schema:{$ref:"#/components/schemas/Pet"}}}},responses:{200:{description:"Return a 200 status to indicate that the data was received successfully"}}}}}},t={withImports:!0,withComments:!1,skipOptionalParameters:!1,withOAuth2Call:!0,spec:e},s={"POST http://petstore.swagger.io/v2/pet":{method:"post",url:"http://petstore.swagger.io/v2/pet",httpVersion:"HTTP/1.1",cookies:[{name:"cookieParam",value:"0"}],headers:[{name:"Content-Type",value:"application/json"},{name:"Accept-Language",value:"en-AU"},{name:"Authorization",value:"Bearer <YOUR_TOKEN_HERE>"}],queryString:[],postData:{mimeType:"application/json",text:'{"category":{"name":"string","sub":{"prop1":"string"}},"name":"Guru","photoUrls":["string"],"friend":{},"tags":[{"name":"string"}],"status":"available","petType":"cat","huntingSkill":"adventurous"}',params:[],jsonObj:{category:{name:"string",sub:{prop1:"string"}},name:"Guru",photoUrls:["string"],friend:{},tags:[{name:"string"}],status:"available",petType:"cat",huntingSkill:"adventurous"}},headersSize:0,bodySize:0,securityOAuth2ExtraCalls:[{method:"POST",url:"http://petstore.swagger.io/api/oauth/dialog",httpVersion:"HTTP/1.1",headers:[{name:"Content-Type",value:"application/x-www-form-urlencoded"},{name:"Accept",value:"application/json"}],queryString:[],postData:{mimeType:"application/x-www-form-urlencoded",text:"",params:[{name:"grant_type",value:"client_credentials"},{name:"client_id",value:"YOUR_CLIENT_ID"},{name:"client_secret",value:"YOUR_CLIENT_SECRET"},{name:"scope",value:"write:pets read:pets"}]},cookies:[],headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:[]}],pathParameters:{},serverVariables:{},queryObj:{},headersObj:{"Content-Type":"application/json","Accept-Language":"en-AU",Authorization:"Bearer <YOUR_TOKEN_HERE>"},cookiesObj:{cookieParam:"0"},allHeaders:{cookie:"cookieParam=0","Content-Type":"application/json","Accept-Language":"en-AU",Authorization:"Bearer <YOUR_TOKEN_HERE>"},uriObj:{protocol:"http:",slashes:!0,auth:null,host:"petstore.swagger.io",port:null,hostname:"petstore.swagger.io",hash:null,search:"",query:{},pathname:"/v2/pet",path:"/v2/pet",href:"http://petstore.swagger.io/v2/pet"},fullUrl:"http://petstore.swagger.io/v2/pet"},"POST http://petstore.swagger.io/v2/pet/{petId}/uploadImage/{data}":{method:"post",url:"http://petstore.swagger.io/v2/pet/{petId}/uploadImage/{data}",httpVersion:"HTTP/1.1",cookies:[],headers:[{name:"Content-Type",value:"application/octet-stream"},{name:"Authorization",value:"Bearer <YOUR_TOKEN_HERE>"}],queryString:[],headersSize:0,bodySize:0,securityOAuth2ExtraCalls:[{method:"POST",url:"http://petstore.swagger.io/api/oauth/dialog",httpVersion:"HTTP/1.1",headers:[{name:"Content-Type",value:"application/x-www-form-urlencoded"},{name:"Accept",value:"application/json"}],queryString:[],postData:{mimeType:"application/x-www-form-urlencoded",text:"",params:[{name:"grant_type",value:"client_credentials"},{name:"client_id",value:"YOUR_CLIENT_ID"},{name:"client_secret",value:"YOUR_CLIENT_SECRET"},{name:"scope",value:"write:pets read:pets"}]},cookies:[],headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:[]}],pathParameters:{petId:"",data:""},serverVariables:{},queryObj:{},headersObj:{"Content-Type":"application/octet-stream",Authorization:"Bearer <YOUR_TOKEN_HERE>"},cookiesObj:{},allHeaders:{"Content-Type":"application/octet-stream",Authorization:"Bearer <YOUR_TOKEN_HERE>"},uriObj:{protocol:"http:",slashes:!0,auth:null,host:"petstore.swagger.io",port:null,hostname:"petstore.swagger.io",hash:null,search:"",query:{},pathname:"/v2/pet/{petId}/uploadImage/{data}",path:"/v2/pet/{petId}/uploadImage/{data}",href:"http://petstore.swagger.io/v2/pet/{petId}/uploadImage/{data}"},fullUrl:"http://petstore.swagger.io/v2/pet/{petId}/uploadImage/{data}"},"PUT http://petstore.swagger.io/v2/pet":{method:"put",url:"http://petstore.swagger.io/v2/pet",httpVersion:"HTTP/1.1",cookies:[{name:"cookieParam",value:"0"}],headers:[{name:"Content-Type",value:"application/json"},{name:"Accept-Language",value:"en-AU"},{name:"Authorization",value:"Bearer <YOUR_TOKEN_HERE>"}],queryString:[],postData:{mimeType:"application/json",text:'{"category":{"name":"string","sub":{"prop1":"string"}},"name":"Guru","photoUrls":["string"],"friend":{},"tags":[{"name":"string"}],"status":"available","petType":"cat","huntingSkill":"adventurous"}',params:[],jsonObj:{category:{name:"string",sub:{prop1:"string"}},name:"Guru",photoUrls:["string"],friend:{},tags:[{name:"string"}],status:"available",petType:"cat",huntingSkill:"adventurous"}},headersSize:0,bodySize:0,securityOAuth2ExtraCalls:[{method:"POST",url:"http://petstore.swagger.io/api/oauth/dialog",httpVersion:"HTTP/1.1",headers:[{name:"Content-Type",value:"application/x-www-form-urlencoded"},{name:"Accept",value:"application/json"}],queryString:[],postData:{mimeType:"application/x-www-form-urlencoded",text:"",params:[{name:"grant_type",value:"client_credentials"},{name:"client_id",value:"YOUR_CLIENT_ID"},{name:"client_secret",value:"YOUR_CLIENT_SECRET"},{name:"scope",value:"write:pets read:pets"}]},cookies:[],headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:[]}],pathParameters:{},serverVariables:{},queryObj:{},headersObj:{"Content-Type":"application/json","Accept-Language":"en-AU",Authorization:"Bearer <YOUR_TOKEN_HERE>"},cookiesObj:{cookieParam:"0"},allHeaders:{cookie:"cookieParam=0","Content-Type":"application/json","Accept-Language":"en-AU",Authorization:"Bearer <YOUR_TOKEN_HERE>"},uriObj:{protocol:"http:",slashes:!0,auth:null,host:"petstore.swagger.io",port:null,hostname:"petstore.swagger.io",hash:null,search:"",query:{},pathname:"/v2/pet",path:"/v2/pet",href:"http://petstore.swagger.io/v2/pet"},fullUrl:"http://petstore.swagger.io/v2/pet"},"POST http://petstore.swagger.io/v2/pet/{petId}/uploadImage":{method:"post",url:"http://petstore.swagger.io/v2/pet/{petId}/uploadImage",httpVersion:"HTTP/1.1",cookies:[],headers:[{name:"Content-Type",value:"application/octet-stream"},{name:"Authorization",value:"Bearer <YOUR_TOKEN_HERE>"}],queryString:[],headersSize:0,bodySize:0,securityOAuth2ExtraCalls:[{method:"POST",url:"http://petstore.swagger.io/api/oauth/dialog",httpVersion:"HTTP/1.1",headers:[{name:"Content-Type",value:"application/x-www-form-urlencoded"},{name:"Accept",value:"application/json"}],queryString:[],postData:{mimeType:"application/x-www-form-urlencoded",text:"",params:[{name:"grant_type",value:"client_credentials"},{name:"client_id",value:"YOUR_CLIENT_ID"},{name:"client_secret",value:"YOUR_CLIENT_SECRET"},{name:"scope",value:"write:pets read:pets"}]},cookies:[],headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:[]}],pathParameters:{petId:""},serverVariables:{},queryObj:{},headersObj:{"Content-Type":"application/octet-stream",Authorization:"Bearer <YOUR_TOKEN_HERE>"},cookiesObj:{},allHeaders:{"Content-Type":"application/octet-stream",Authorization:"Bearer <YOUR_TOKEN_HERE>"},uriObj:{protocol:"http:",slashes:!0,auth:null,host:"petstore.swagger.io",port:null,hostname:"petstore.swagger.io",hash:null,search:"",query:{},pathname:"/v2/pet/{petId}/uploadImage",path:"/v2/pet/{petId}/uploadImage",href:"http://petstore.swagger.io/v2/pet/{petId}/uploadImage"},fullUrl:"http://petstore.swagger.io/v2/pet/{petId}/uploadImage"},"GET http://petstore.swagger.io/v2/pet/findByStatus/{id}":{method:"get",url:"http://petstore.swagger.io/v2/pet/findByStatus/{id}",httpVersion:"HTTP/1.1",cookies:[],headers:[{name:"Authorization",value:"Bearer <YOUR_TOKEN_HERE>"}],queryString:[{name:"status",value:"available"}],headersSize:0,bodySize:0,securityOAuth2ExtraCalls:[{method:"POST",url:"http://petstore.swagger.io/api/oauth/dialog",httpVersion:"HTTP/1.1",headers:[{name:"Content-Type",value:"application/x-www-form-urlencoded"},{name:"Accept",value:"application/json"}],queryString:[],postData:{mimeType:"application/x-www-form-urlencoded",text:"",params:[{name:"grant_type",value:"client_credentials"},{name:"client_id",value:"YOUR_CLIENT_ID"},{name:"client_secret",value:"YOUR_CLIENT_SECRET"},{name:"scope",value:"write:pets read:pets"}]},cookies:[],headersSize:-1,bodySize:-1,securityOAuth2ExtraCalls:[]}],pathParameters:{id:""},serverVariables:{},queryObj:{status:"available"},headersObj:{Authorization:"Bearer <YOUR_TOKEN_HERE>"},cookiesObj:{},allHeaders:{Authorization:"Bearer <YOUR_TOKEN_HERE>"},uriObj:{protocol:"http:",slashes:!0,auth:null,host:"petstore.swagger.io",port:null,hostname:"petstore.swagger.io",hash:null,search:"status=available",query:{status:"available"},pathname:"/v2/pet/findByStatus/{id}",path:"/v2/pet/findByStatus/{id}?status=available",href:"http://petstore.swagger.io/v2/pet/findByStatus/%7Bid%7D"},fullUrl:"http://petstore.swagger.io/v2/pet/findByStatus/{id}?status=available"},"POST https://{customerId}.saas-app.com:{port}/v2":{method:"post",url:"https://{customerId}.saas-app.com:{port}/v2/pet",httpVersion:"HTTP/1.1",cookies:[{name:"cookieParam",value:"0"}],headers:[{name:"Content-Type",value:"application/json"},{name:"Accept-Language",value:"en-AU"},{name:"Authorization",value:"Bearer <YOUR_TOKEN_HERE>"}],queryString:[],postData:{mimeType:"application/json",text:"text",params:[],jsonObj:{category:{name:"string",sub:{prop1:"string"}},name:"Guru",photoUrls:["string"],friend:{},tags:[{name:"string"}],cvv_check:"string",status:"available",petType:"cat",huntingSkill:"adventurous"}},headersSize:0,bodySize:0,securityOAuth2ExtraCalls:[],pathParameters:{},serverVariables:{customerId:"demo",port:"443"},queryObj:{},headersObj:{"Content-Type":"application/json","Accept-Language":"en-AU",Authorization:"Bearer <YOUR_TOKEN_HERE>"},cookiesObj:{cookieParam:"0"},allHeaders:{cookie:"cookieParam=0","Content-Type":"application/json","Accept-Language":"en-AU",Authorization:"Bearer <YOUR_TOKEN_HERE>"},uriObj:{protocol:"https:",slashes:!0,auth:null,host:"",port:null,hostname:"",hash:null,search:"",query:{},pathname:"{customerId}.saas-app.com:{port}/v2/pet",path:"{customerId}.saas-app.com:{port}/v2/pet",href:"https:///%7BcustomerId%7D.saas-app.com:%7Bport%7D/v2/pet"},fullUrl:"https://{customerId}.saas-app.com:{port}/v2/pet"},"POST http://petstore.swagger.io/login":{method:"post",url:"http://petstore.swagger.io/login",httpVersion:"HTTP/1.1",headers:[],queryString:[],postData:{mimeType:"application/json",text:"text",params:[],jsonObj:{}},basicAuth:{username:"usernamestring",password:"passwordstring"},headersSize:0,bodySize:0,securityOAuth2ExtraCalls:[],pathParameters:{},queryObj:{},headersObj:{},cookiesObj:{},allHeaders:{},serverVariables:{},cookies:[{name:"cookieParam",value:"0"}],uriObj:{protocol:"https:",slashes:!0,auth:null,host:"",port:null,hostname:"",hash:null,search:"",query:{},pathname:"petstore.swagger.io/login",path:"petstore.swagger.io/login",href:"https://petstore.swagger.io/login"},fullUrl:"https://petstore.swagger.io/login"},"POST http://petstore.swagger.io/v2/uploadImage":{httpVersion:"HTTP/1.1",queryString:[],basicAuth:{username:"usernamestring",password:"passwordstring"},headersSize:0,bodySize:0,securityOAuth2ExtraCalls:[],pathParameters:{},queryObj:{},headersObj:{},cookiesObj:{},allHeaders:{},serverVariables:{},cookies:[{name:"cookieParam",value:"0"}],uriObj:{protocol:"https:",slashes:!0,auth:null,host:"",port:null,hostname:"",hash:null,search:"",query:{},pathname:"petstore.swagger.io/login",path:"petstore.swagger.io/login",href:"https://petstore.swagger.io/login"},fullUrl:"https://petstore.swagger.io/login",method:"POST",url:"http://petstore.swagger.io/v2/uploadImage",headers:[],postData:{mimeType:"multipart/form-data",params:[{name:"file",value:"pet_image.png"},{name:"description",value:"Pet photo"}]}}},r={withImports:!0,withComments:!1,skipOptionalParameters:!1,withOAuth2Call:!0,spec:{...e,servers:[{url:"https://{customerId}.saas-app.com:{port}/v2",variables:{customerId:{default:"demo",description:"Customer ID assigned by the service provider"},port:{enum:["443","8443"],default:"443"}}}]}};export{t as originalOptions,r as serverVariablesOptions,s as source};
1
+ const spec = {
2
+ openapi: '3.0.0',
3
+ servers: [
4
+ {
5
+ url: '//petstore.swagger.io/v2',
6
+ description: 'Default server',
7
+ },
8
+ {
9
+ url: '//petstore.swagger.io/sandbox',
10
+ description: 'Sandbox server',
11
+ },
12
+ ],
13
+ info: {
14
+ description: 'This is a sample server Petstore server.\nYou can find out more about Swagger at\n[http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/).\nFor this sample, you can use the api key `special-key` to test the authorization filters.\n\n# Introduction\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n# OpenAPI Specification\nThis API is documented in **OpenAPI format** and is based on\n[Petstore sample](http://petstore.swagger.io/) provided by [swagger.io](http://swagger.io) team.\nIt was **extended** to illustrate features of [generator-openapi-repo](https://github.com/Rebilly/generator-openapi-repo)\ntool and [ReDoc](https://github.com/Redocly/redoc) documentation. In addition to standard\nOpenAPI syntax we use a few [vendor extensions](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md).\n\n## Subheader 1\n\nConsectetur adipiscing elit. Etiam fringilla tincidunt magna non dignissim. Vestibulum vestibulum ipsum augue, sed rhoncus diam consequat sodales. Sed facilisis maximus enim, ut scelerisque lorem ullamcorper eget. Suspendisse venenatis non lectus sed bibendum.\n*Duis neque ante, ultrices at ornare aliquam, vulputate ac dolor.*\n\n## Subheader 2\n\nLorem ipsum dolor sit amet. Ut tempor sem vitae dui varius, consequat varius ligula fringilla. Nulla accumsan pellentesque lorem eu pharetra. Duis vel est metus. Nulla id quam eget ante egestas fringilla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur vulputate pulvinar turpis, ac convallis quam.\n\n# Cross-Origin Resource Sharing\nThis API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/).\nAnd that allows cross-domain communication from the browser.\nAll responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.\n\n# Authentication\n\nPetstore offers two forms of authentication:\n - API Key\n - OAuth2\nOAuth2 - an open protocol to allow secure authorization in a simple\nand standard method from web, mobile and desktop applications.\n',
15
+ version: '1.0.0',
16
+ title: 'Swagger Petstore',
17
+ termsOfService: 'http://swagger.io/terms/',
18
+ contact: {
19
+ name: 'API Support',
20
+ email: 'apiteam@swagger.io',
21
+ url: 'https://github.com/Redocly/redoc',
22
+ },
23
+ 'x-logo': {
24
+ url: 'https://redocly.github.io/redoc/petstore-logo.png',
25
+ altText: 'Petstore logo',
26
+ },
27
+ license: {
28
+ name: 'Apache 2.0',
29
+ url: 'http://www.apache.org/licenses/LICENSE-2.0.html',
30
+ },
31
+ },
32
+ externalDocs: {
33
+ description: 'Find out how to create Github repo for your OpenAPI spec.',
34
+ url: 'https://github.com/Rebilly/generator-openapi-repo',
35
+ },
36
+ tags: [
37
+ {
38
+ name: 'pet',
39
+ description: 'Lorem ipsum dolor sit amet.\n\n**Consectetur** adipiscing elit. Etiam fringilla tincidunt magna non dignissim. Vestibulum vestibulum ipsum augue, sed rhoncus diam consequat sodales. Sed facilisis maximus enim, ut scelerisque lorem ullamcorper eget. Suspendisse venenatis non lectus sed bibendum.\n*Duis neque ante, ultrices at ornare aliquam, vulputate ac dolor.*\n\nPellentesque nulla lorem:\n- dapibus lacinia magna vitae, \n- eleifend bibendum nisi\n\nNullam pretium erat ut augue mollis, id varius orci pretium. \n> Ut efficitur eget dui eget molestie.\n\nUt tempor sem vitae dui varius, consequat varius ligula fringilla. Nulla accumsan pellentesque lorem eu pharetra. Duis vel est metus. Nulla id quam eget ante egestas fringilla. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur vulputate pulvinar turpis, ac convallis quam.\n[More info](http://swagger.io)\n',
40
+ },
41
+ {
42
+ name: 'store',
43
+ },
44
+ {
45
+ name: 'user',
46
+ description: 'Operations about user\n\n## Custom section 1\nNullam pretium erat ut augue mollis, id varius orci pretium. \n\n\n## Custom section 2\nNulla accumsan pellentesque lorem eu pharetra. Duis vel est metus. Nulla id quam eget ante egestas fringilla. Lorem ipsum dolor sit amet, consectetur adipiscing elit.\n\nSome Item\n',
47
+ },
48
+ {
49
+ name: 'pet_model',
50
+ 'x-displayName': 'The Pet Model',
51
+ description: '<SchemaDefinition schemaRef="#/components/schemas/Pet" />\n',
52
+ },
53
+ {
54
+ name: 'store_model',
55
+ 'x-displayName': 'The Order Model',
56
+ description: '<SchemaDefinition schemaRef="#/components/schemas/Order" exampleRef="#/components/examples/Order" showReadOnly={true} showWriteOnly={true} />\n',
57
+ },
58
+ ],
59
+ 'x-tagGroups': [
60
+ {
61
+ name: 'General',
62
+ tags: ['pet', 'store'],
63
+ },
64
+ {
65
+ name: 'User Management',
66
+ tags: ['user'],
67
+ },
68
+ {
69
+ name: 'Models',
70
+ tags: ['pet_model', 'store_model'],
71
+ },
72
+ ],
73
+ paths: {
74
+ '/pet': {
75
+ parameters: [
76
+ {
77
+ name: 'Accept-Language',
78
+ in: 'header',
79
+ description: 'The language you prefer for messages. Supported values are en-AU, en-CA, en-GB, en-US',
80
+ example: 'en-US',
81
+ required: false,
82
+ schema: {
83
+ type: 'string',
84
+ default: 'en-AU',
85
+ },
86
+ },
87
+ {
88
+ name: 'cookieParam',
89
+ in: 'cookie',
90
+ description: 'Some cookie',
91
+ required: true,
92
+ schema: {
93
+ type: 'integer',
94
+ format: 'int64',
95
+ },
96
+ },
97
+ ],
98
+ post: {
99
+ tags: ['pet'],
100
+ summary: 'Add a new pet to the store',
101
+ description: 'Add new pet to the store inventory.',
102
+ operationId: 'addPet',
103
+ responses: {
104
+ '405': {
105
+ description: 'Invalid input',
106
+ },
107
+ },
108
+ security: [
109
+ {
110
+ petstore_auth: ['write:pets', 'read:pets'],
111
+ },
112
+ ],
113
+ 'x-codeSamples': [
114
+ {
115
+ lang: 'C#',
116
+ source: 'PetStore.v1.Pet pet = new PetStore.v1.Pet();\npet.setApiKey("your api key");\npet.petType = PetStore.v1.Pet.TYPE_DOG;\npet.name = "Rex";\n// set other fields\nPetStoreResponse response = pet.create();\nif (response.statusCode == HttpStatusCode.Created)\n{\n // Successfully created\n}\nelse\n{\n // Something wrong -- check response for errors\n Console.WriteLine(response.getRawResponse());\n}\n',
117
+ },
118
+ {
119
+ lang: 'PHP',
120
+ source: '$form = new \\PetStore\\Entities\\Pet();\n$form->setPetType("Dog");\n$form->setName("Rex");\n// set other fields\ntry {\n $pet = $client->pets()->create($form);\n} catch (UnprocessableEntityException $e) {\n var_dump($e->getErrors());\n}\n',
121
+ },
122
+ ],
123
+ requestBody: {
124
+ $ref: '#/components/requestBodies/Pet',
125
+ },
126
+ },
127
+ put: {
128
+ tags: ['pet'],
129
+ summary: 'Update an existing pet',
130
+ description: '',
131
+ operationId: 'updatePet',
132
+ responses: {
133
+ '400': {
134
+ description: 'Invalid ID supplied',
135
+ },
136
+ '404': {
137
+ description: 'Pet not found',
138
+ },
139
+ '405': {
140
+ description: 'Validation exception',
141
+ },
142
+ },
143
+ security: [
144
+ {
145
+ petstore_auth: ['write:pets', 'read:pets'],
146
+ },
147
+ ],
148
+ 'x-codeSamples': [
149
+ {
150
+ lang: 'PHP',
151
+ source: '$form = new \\PetStore\\Entities\\Pet();\n$form->setPetId(1);\n$form->setPetType("Dog");\n$form->setName("Rex");\n// set other fields\ntry {\n $pet = $client->pets()->update($form);\n} catch (UnprocessableEntityException $e) {\n var_dump($e->getErrors());\n}\n',
152
+ },
153
+ ],
154
+ requestBody: {
155
+ $ref: '#/components/requestBodies/Pet',
156
+ },
157
+ },
158
+ },
159
+ '/pet/{petId}': {
160
+ get: {
161
+ tags: ['pet'],
162
+ summary: 'Find pet by ID',
163
+ description: 'Returns a single pet',
164
+ operationId: 'getPetById',
165
+ parameters: [
166
+ {
167
+ name: 'petId',
168
+ in: 'path',
169
+ description: 'ID of pet to return',
170
+ required: true,
171
+ deprecated: true,
172
+ schema: {
173
+ type: 'integer',
174
+ format: 'int64',
175
+ },
176
+ },
177
+ ],
178
+ responses: {
179
+ '200': {
180
+ description: 'successful operation',
181
+ content: {
182
+ 'application/json': {
183
+ schema: {
184
+ $ref: '#/components/schemas/Pet',
185
+ },
186
+ },
187
+ 'application/xml': {
188
+ schema: {
189
+ $ref: '#/components/schemas/Pet',
190
+ },
191
+ },
192
+ },
193
+ },
194
+ '400': {
195
+ description: 'Invalid ID supplied',
196
+ },
197
+ '404': {
198
+ description: 'Pet not found',
199
+ },
200
+ },
201
+ security: [
202
+ {
203
+ api_key: [],
204
+ },
205
+ ],
206
+ },
207
+ post: {
208
+ tags: ['pet'],
209
+ summary: 'Updates a pet in the store with form data',
210
+ description: '',
211
+ operationId: 'updatePetWithForm',
212
+ parameters: [
213
+ {
214
+ name: 'petId',
215
+ in: 'path',
216
+ description: 'ID of pet that needs to be updated',
217
+ required: true,
218
+ schema: {
219
+ type: 'integer',
220
+ format: 'int64',
221
+ },
222
+ },
223
+ ],
224
+ responses: {
225
+ '405': {
226
+ description: 'Invalid input',
227
+ },
228
+ },
229
+ security: [
230
+ {
231
+ petstore_auth: ['write:pets', 'read:pets'],
232
+ },
233
+ ],
234
+ requestBody: {
235
+ content: {
236
+ 'application/x-www-form-urlencoded': {
237
+ schema: {
238
+ type: 'object',
239
+ properties: {
240
+ name: {
241
+ description: 'Updated name of the pet',
242
+ type: 'string',
243
+ },
244
+ status: {
245
+ description: 'Updated status of the pet',
246
+ type: 'string',
247
+ },
248
+ },
249
+ },
250
+ },
251
+ },
252
+ },
253
+ },
254
+ delete: {
255
+ tags: ['pet'],
256
+ summary: 'Deletes a pet',
257
+ description: '',
258
+ operationId: 'deletePet',
259
+ parameters: [
260
+ {
261
+ name: 'api_key',
262
+ in: 'header',
263
+ required: false,
264
+ schema: {
265
+ type: 'string',
266
+ },
267
+ example: 'Bearer <TOKEN>',
268
+ },
269
+ {
270
+ name: 'petId',
271
+ in: 'path',
272
+ description: 'Pet id to delete',
273
+ required: true,
274
+ schema: {
275
+ type: 'integer',
276
+ format: 'int64',
277
+ },
278
+ },
279
+ ],
280
+ responses: {
281
+ '400': {
282
+ description: 'Invalid pet value',
283
+ },
284
+ },
285
+ security: [
286
+ {
287
+ petstore_auth: ['write:pets', 'read:pets'],
288
+ },
289
+ ],
290
+ },
291
+ },
292
+ '/pet/{petId}/uploadImage': {
293
+ post: {
294
+ tags: ['pet'],
295
+ summary: 'uploads an image',
296
+ description: '',
297
+ operationId: 'uploadFile',
298
+ parameters: [
299
+ {
300
+ name: 'petId',
301
+ in: 'path',
302
+ description: 'ID of pet to update',
303
+ required: true,
304
+ schema: {
305
+ type: 'integer',
306
+ format: 'int64',
307
+ },
308
+ },
309
+ ],
310
+ responses: {
311
+ '200': {
312
+ description: 'successful operation',
313
+ content: {
314
+ 'application/json': {
315
+ schema: {
316
+ $ref: '#/components/schemas/ApiResponse',
317
+ },
318
+ },
319
+ },
320
+ },
321
+ },
322
+ security: [
323
+ {
324
+ petstore_auth: ['write:pets', 'read:pets'],
325
+ },
326
+ ],
327
+ requestBody: {
328
+ content: {
329
+ 'application/octet-stream': {
330
+ schema: {
331
+ type: 'string',
332
+ format: 'binary',
333
+ },
334
+ },
335
+ },
336
+ },
337
+ },
338
+ },
339
+ '/pet/{petId}/uploadImage/{data}': {
340
+ post: {
341
+ tags: ['pet'],
342
+ summary: 'uploads an image',
343
+ description: '',
344
+ operationId: 'uploadFile',
345
+ parameters: [
346
+ {
347
+ name: 'petId',
348
+ in: 'path',
349
+ description: 'ID of pet to update',
350
+ required: true,
351
+ schema: {
352
+ type: 'integer',
353
+ format: 'int64',
354
+ },
355
+ },
356
+ {
357
+ name: 'data',
358
+ in: 'path',
359
+ description: 'ID of pet to update',
360
+ required: true,
361
+ schema: {
362
+ type: 'integer',
363
+ format: 'int64',
364
+ },
365
+ },
366
+ ],
367
+ responses: {
368
+ '200': {
369
+ description: 'successful operation',
370
+ content: {
371
+ 'application/json': {
372
+ schema: {
373
+ $ref: '#/components/schemas/ApiResponse',
374
+ },
375
+ },
376
+ },
377
+ },
378
+ },
379
+ security: [
380
+ {
381
+ petstore_auth: ['write:pets', 'read:pets'],
382
+ },
383
+ ],
384
+ requestBody: {
385
+ content: {
386
+ 'application/octet-stream': {
387
+ schema: {
388
+ type: 'string',
389
+ format: 'binary',
390
+ },
391
+ },
392
+ },
393
+ },
394
+ },
395
+ },
396
+ '/pet/findByStatus': {
397
+ get: {
398
+ tags: ['pet'],
399
+ summary: 'Finds Pets by status',
400
+ description: 'Multiple status values can be provided with comma separated strings',
401
+ operationId: 'findPetsByStatus',
402
+ parameters: [
403
+ {
404
+ name: 'status',
405
+ in: 'query',
406
+ description: 'Status values that need to be considered for filter',
407
+ required: true,
408
+ style: 'form',
409
+ schema: {
410
+ type: 'array',
411
+ minItems: 1,
412
+ maxItems: 3,
413
+ items: {
414
+ type: 'string',
415
+ enum: ['available', 'pending', 'sold'],
416
+ default: 'available',
417
+ },
418
+ },
419
+ },
420
+ ],
421
+ responses: {
422
+ '200': {
423
+ description: 'successful operation',
424
+ content: {
425
+ 'application/json': {
426
+ schema: {
427
+ type: 'array',
428
+ items: {
429
+ $ref: '#/components/schemas/Pet',
430
+ },
431
+ },
432
+ },
433
+ 'application/xml': {
434
+ schema: {
435
+ type: 'array',
436
+ items: {
437
+ $ref: '#/components/schemas/Pet',
438
+ },
439
+ },
440
+ },
441
+ },
442
+ },
443
+ '400': {
444
+ description: 'Invalid status value',
445
+ },
446
+ },
447
+ security: [
448
+ {
449
+ petstore_auth: ['write:pets', 'read:pets'],
450
+ },
451
+ ],
452
+ },
453
+ },
454
+ '/pet/findByTags': {
455
+ get: {
456
+ tags: ['pet'],
457
+ summary: 'Finds Pets by tags',
458
+ description: 'Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.',
459
+ operationId: 'findPetsByTags',
460
+ deprecated: true,
461
+ parameters: [
462
+ {
463
+ name: 'tags',
464
+ in: 'query',
465
+ description: 'Tags to filter by',
466
+ required: true,
467
+ style: 'form',
468
+ schema: {
469
+ type: 'array',
470
+ items: {
471
+ type: 'string',
472
+ },
473
+ },
474
+ },
475
+ ],
476
+ responses: {
477
+ '200': {
478
+ description: 'successful operation',
479
+ content: {
480
+ 'application/json': {
481
+ schema: {
482
+ type: 'array',
483
+ items: {
484
+ $ref: '#/components/schemas/Pet',
485
+ },
486
+ },
487
+ },
488
+ 'application/xml': {
489
+ schema: {
490
+ type: 'array',
491
+ items: {
492
+ $ref: '#/components/schemas/Pet',
493
+ },
494
+ },
495
+ },
496
+ },
497
+ },
498
+ '400': {
499
+ description: 'Invalid tag value',
500
+ },
501
+ },
502
+ security: [
503
+ {
504
+ petstore_auth: ['write:pets', 'read:pets'],
505
+ },
506
+ ],
507
+ },
508
+ },
509
+ '/store/inventory': {
510
+ get: {
511
+ tags: ['store'],
512
+ summary: 'Returns pet inventories by status',
513
+ description: 'Returns a map of status codes to quantities',
514
+ operationId: 'getInventory',
515
+ responses: {
516
+ '200': {
517
+ description: 'successful operation',
518
+ content: {
519
+ 'application/json': {
520
+ schema: {
521
+ type: 'object',
522
+ additionalProperties: {
523
+ type: 'integer',
524
+ format: 'int32',
525
+ },
526
+ },
527
+ },
528
+ },
529
+ },
530
+ },
531
+ security: [
532
+ {
533
+ api_key: [],
534
+ },
535
+ ],
536
+ },
537
+ },
538
+ '/store/order': {
539
+ post: {
540
+ tags: ['store'],
541
+ summary: 'Place an order for a pet',
542
+ description: '',
543
+ operationId: 'placeOrder',
544
+ responses: {
545
+ '200': {
546
+ description: 'successful operation',
547
+ content: {
548
+ 'application/json': {
549
+ schema: {
550
+ $ref: '#/components/schemas/Order',
551
+ },
552
+ },
553
+ 'application/xml': {
554
+ schema: {
555
+ $ref: '#/components/schemas/Order',
556
+ },
557
+ },
558
+ },
559
+ },
560
+ '400': {
561
+ description: 'Invalid Order',
562
+ content: {
563
+ 'application/json': {
564
+ example: {
565
+ status: 400,
566
+ message: 'Invalid Order',
567
+ },
568
+ },
569
+ },
570
+ },
571
+ },
572
+ requestBody: {
573
+ content: {
574
+ 'application/json': {
575
+ schema: {
576
+ $ref: '#/components/schemas/Order',
577
+ },
578
+ },
579
+ },
580
+ description: 'order placed for purchasing the pet',
581
+ required: true,
582
+ },
583
+ },
584
+ },
585
+ '/store/order/{orderId}': {
586
+ get: {
587
+ tags: ['store'],
588
+ summary: 'Find purchase order by ID',
589
+ description: 'For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions',
590
+ operationId: 'getOrderById',
591
+ parameters: [
592
+ {
593
+ name: 'orderId',
594
+ in: 'path',
595
+ description: 'ID of pet that needs to be fetched',
596
+ required: true,
597
+ schema: {
598
+ type: 'integer',
599
+ format: 'int64',
600
+ minimum: 1,
601
+ maximum: 5,
602
+ },
603
+ },
604
+ ],
605
+ responses: {
606
+ '200': {
607
+ description: 'successful operation',
608
+ content: {
609
+ 'application/json': {
610
+ schema: {
611
+ $ref: '#/components/schemas/Order',
612
+ },
613
+ },
614
+ 'application/xml': {
615
+ schema: {
616
+ $ref: '#/components/schemas/Order',
617
+ },
618
+ },
619
+ },
620
+ },
621
+ '400': {
622
+ description: 'Invalid ID supplied',
623
+ },
624
+ '404': {
625
+ description: 'Order not found',
626
+ },
627
+ },
628
+ },
629
+ delete: {
630
+ tags: ['store'],
631
+ summary: 'Delete purchase order by ID',
632
+ description: 'For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors',
633
+ operationId: 'deleteOrder',
634
+ parameters: [
635
+ {
636
+ name: 'orderId',
637
+ in: 'path',
638
+ description: 'ID of the order that needs to be deleted',
639
+ required: true,
640
+ schema: {
641
+ type: 'string',
642
+ minimum: 1,
643
+ },
644
+ },
645
+ ],
646
+ responses: {
647
+ '400': {
648
+ description: 'Invalid ID supplied',
649
+ },
650
+ '404': {
651
+ description: 'Order not found',
652
+ },
653
+ },
654
+ },
655
+ },
656
+ '/store/subscribe': {
657
+ post: {
658
+ tags: ['store'],
659
+ summary: 'Subscribe to the Store events',
660
+ description: 'Add subscription for a store events',
661
+ requestBody: {
662
+ content: {
663
+ 'application/json': {
664
+ schema: {
665
+ type: 'object',
666
+ properties: {
667
+ callbackUrl: {
668
+ type: 'string',
669
+ format: 'uri',
670
+ description: 'This URL will be called by the server when the desired event will occur',
671
+ example: 'https://myserver.com/send/callback/here',
672
+ },
673
+ eventName: {
674
+ type: 'string',
675
+ description: 'Event name for the subscription',
676
+ enum: ['orderInProgress', 'orderShipped', 'orderDelivered'],
677
+ example: 'orderInProgress',
678
+ },
679
+ },
680
+ required: ['callbackUrl', 'eventName'],
681
+ },
682
+ },
683
+ },
684
+ },
685
+ responses: {
686
+ '201': {
687
+ description: 'Subscription added',
688
+ content: {
689
+ 'application/json': {
690
+ schema: {
691
+ type: 'object',
692
+ properties: {
693
+ subscriptionId: {
694
+ type: 'string',
695
+ example: 'AAA-123-BBB-456',
696
+ },
697
+ },
698
+ },
699
+ },
700
+ },
701
+ },
702
+ },
703
+ callbacks: {
704
+ orderInProgress: {
705
+ '{$request.body#/callbackUrl}?event={$request.body#/eventName}': {
706
+ servers: [
707
+ {
708
+ url: '//callback-url.path-level/v1',
709
+ description: 'Path level server 1',
710
+ },
711
+ {
712
+ url: '//callback-url.path-level/v2',
713
+ description: 'Path level server 2',
714
+ },
715
+ ],
716
+ post: {
717
+ summary: 'Order in Progress (Summary)',
718
+ description: 'A callback triggered every time an Order is updated status to "inProgress" (Description)',
719
+ externalDocs: {
720
+ description: 'Find out more',
721
+ url: 'https://more-details.com/demo',
722
+ },
723
+ requestBody: {
724
+ content: {
725
+ 'application/json': {
726
+ schema: {
727
+ type: 'object',
728
+ properties: {
729
+ orderId: {
730
+ type: 'string',
731
+ example: '123',
732
+ },
733
+ timestamp: {
734
+ type: 'string',
735
+ format: 'date-time',
736
+ example: '2018-10-19T16:46:45Z',
737
+ },
738
+ status: {
739
+ type: 'string',
740
+ example: 'inProgress',
741
+ },
742
+ },
743
+ },
744
+ },
745
+ 'application/xml': {
746
+ schema: {
747
+ type: 'object',
748
+ properties: {
749
+ orderId: {
750
+ type: 'string',
751
+ example: '123',
752
+ },
753
+ },
754
+ },
755
+ example: '<?xml version="1.0" encoding="UTF-8"?>\n<root>\n <orderId>123</orderId>\n <status>inProgress</status>\n <timestamp>2018-10-19T16:46:45Z</timestamp>\n</root>\n',
756
+ },
757
+ },
758
+ },
759
+ responses: {
760
+ '200': {
761
+ description: 'Callback successfully processed and no retries will be performed',
762
+ content: {
763
+ 'application/json': {
764
+ schema: {
765
+ type: 'object',
766
+ properties: {
767
+ someProp: {
768
+ type: 'string',
769
+ example: '123',
770
+ },
771
+ },
772
+ },
773
+ },
774
+ },
775
+ },
776
+ '299': {
777
+ description: 'Response for cancelling subscription',
778
+ },
779
+ '500': {
780
+ description: 'Callback processing failed and retries will be performed',
781
+ },
782
+ },
783
+ 'x-codeSamples': [
784
+ {
785
+ lang: 'C#',
786
+ source: 'PetStore.v1.Pet pet = new PetStore.v1.Pet();\npet.setApiKey("your api key");\npet.petType = PetStore.v1.Pet.TYPE_DOG;\npet.name = "Rex";\n// set other fields\nPetStoreResponse response = pet.create();\nif (response.statusCode == HttpStatusCode.Created)\n{\n // Successfully created\n}\nelse\n{\n // Something wrong -- check response for errors\n Console.WriteLine(response.getRawResponse());\n}\n',
787
+ },
788
+ {
789
+ lang: 'PHP',
790
+ source: '$form = new \\PetStore\\Entities\\Pet();\n$form->setPetType("Dog");\n$form->setName("Rex");\n// set other fields\ntry {\n $pet = $client->pets()->create($form);\n} catch (UnprocessableEntityException $e) {\n var_dump($e->getErrors());\n}\n',
791
+ },
792
+ ],
793
+ },
794
+ put: {
795
+ description: 'Order in Progress (Only Description)',
796
+ servers: [
797
+ {
798
+ url: '//callback-url.operation-level/v1',
799
+ description: 'Operation level server 1 (Operation override)',
800
+ },
801
+ {
802
+ url: '//callback-url.operation-level/v2',
803
+ description: 'Operation level server 2 (Operation override)',
804
+ },
805
+ ],
806
+ requestBody: {
807
+ content: {
808
+ 'application/json': {
809
+ schema: {
810
+ type: 'object',
811
+ properties: {
812
+ orderId: {
813
+ type: 'string',
814
+ example: '123',
815
+ },
816
+ timestamp: {
817
+ type: 'string',
818
+ format: 'date-time',
819
+ example: '2018-10-19T16:46:45Z',
820
+ },
821
+ status: {
822
+ type: 'string',
823
+ example: 'inProgress',
824
+ },
825
+ },
826
+ },
827
+ },
828
+ 'application/xml': {
829
+ schema: {
830
+ type: 'object',
831
+ properties: {
832
+ orderId: {
833
+ type: 'string',
834
+ example: '123',
835
+ },
836
+ },
837
+ },
838
+ example: '<?xml version="1.0" encoding="UTF-8"?>\n<root>\n <orderId>123</orderId>\n <status>inProgress</status>\n <timestamp>2018-10-19T16:46:45Z</timestamp>\n</root>\n',
839
+ },
840
+ },
841
+ },
842
+ responses: {
843
+ '200': {
844
+ description: 'Callback successfully processed and no retries will be performed',
845
+ content: {
846
+ 'application/json': {
847
+ schema: {
848
+ type: 'object',
849
+ properties: {
850
+ someProp: {
851
+ type: 'string',
852
+ example: '123',
853
+ },
854
+ },
855
+ },
856
+ },
857
+ },
858
+ },
859
+ },
860
+ },
861
+ },
862
+ },
863
+ orderShipped: {
864
+ '{$request.body#/callbackUrl}?event={$request.body#/eventName}': {
865
+ post: {
866
+ description: 'Very long description\nLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor\nincididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis\nnostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.\nDuis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu\nfugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in\nculpa qui officia deserunt mollit anim id est laborum.\n',
867
+ requestBody: {
868
+ content: {
869
+ 'application/json': {
870
+ schema: {
871
+ type: 'object',
872
+ properties: {
873
+ orderId: {
874
+ type: 'string',
875
+ example: '123',
876
+ },
877
+ timestamp: {
878
+ type: 'string',
879
+ format: 'date-time',
880
+ example: '2018-10-19T16:46:45Z',
881
+ },
882
+ estimatedDeliveryDate: {
883
+ type: 'string',
884
+ format: 'date-time',
885
+ example: '2018-11-11T16:00:00Z',
886
+ },
887
+ },
888
+ },
889
+ },
890
+ },
891
+ },
892
+ responses: {
893
+ '200': {
894
+ description: 'Callback successfully processed and no retries will be performed',
895
+ },
896
+ },
897
+ },
898
+ },
899
+ },
900
+ orderDelivered: {
901
+ 'http://notificationServer.com?url={$request.body#/callbackUrl}&event={$request.body#/eventName}': {
902
+ post: {
903
+ deprecated: true,
904
+ summary: 'Order delivered',
905
+ description: 'A callback triggered every time an Order is delivered to the recipient',
906
+ requestBody: {
907
+ content: {
908
+ 'application/json': {
909
+ schema: {
910
+ type: 'object',
911
+ properties: {
912
+ orderId: {
913
+ type: 'string',
914
+ example: '123',
915
+ },
916
+ timestamp: {
917
+ type: 'string',
918
+ format: 'date-time',
919
+ example: '2018-10-19T16:46:45Z',
920
+ },
921
+ },
922
+ },
923
+ },
924
+ },
925
+ },
926
+ responses: {
927
+ '200': {
928
+ description: 'Callback successfully processed and no retries will be performed',
929
+ },
930
+ },
931
+ },
932
+ },
933
+ },
934
+ },
935
+ },
936
+ },
937
+ '/user': {
938
+ post: {
939
+ tags: ['user'],
940
+ summary: 'Create user',
941
+ description: 'This can only be done by the logged in user.',
942
+ operationId: 'createUser',
943
+ responses: {
944
+ default: {
945
+ description: 'successful operation',
946
+ },
947
+ },
948
+ requestBody: {
949
+ content: {
950
+ 'application/json': {
951
+ schema: {
952
+ $ref: '#/components/schemas/User',
953
+ },
954
+ },
955
+ },
956
+ description: 'Created user object',
957
+ required: true,
958
+ },
959
+ },
960
+ },
961
+ '/user/{username}': {
962
+ get: {
963
+ tags: ['user'],
964
+ summary: 'Get user by user name',
965
+ description: '',
966
+ operationId: 'getUserByName',
967
+ parameters: [
968
+ {
969
+ name: 'username',
970
+ in: 'path',
971
+ description: 'The name that needs to be fetched. Use user1 for testing. ',
972
+ required: true,
973
+ schema: {
974
+ type: 'string',
975
+ },
976
+ },
977
+ ],
978
+ responses: {
979
+ '200': {
980
+ description: 'successful operation',
981
+ content: {
982
+ 'application/json': {
983
+ schema: {
984
+ $ref: '#/components/schemas/User',
985
+ },
986
+ },
987
+ 'application/xml': {
988
+ schema: {
989
+ $ref: '#/components/schemas/User',
990
+ },
991
+ },
992
+ },
993
+ },
994
+ '400': {
995
+ description: 'Invalid username supplied',
996
+ },
997
+ '404': {
998
+ description: 'User not found',
999
+ },
1000
+ },
1001
+ },
1002
+ put: {
1003
+ tags: ['user'],
1004
+ summary: 'Updated user',
1005
+ description: 'This can only be done by the logged in user.',
1006
+ operationId: 'updateUser',
1007
+ parameters: [
1008
+ {
1009
+ name: 'username',
1010
+ in: 'path',
1011
+ description: 'name that need to be deleted',
1012
+ required: true,
1013
+ schema: {
1014
+ type: 'string',
1015
+ },
1016
+ },
1017
+ ],
1018
+ responses: {
1019
+ '400': {
1020
+ description: 'Invalid user supplied',
1021
+ },
1022
+ '404': {
1023
+ description: 'User not found',
1024
+ },
1025
+ },
1026
+ requestBody: {
1027
+ content: {
1028
+ 'application/json': {
1029
+ schema: {
1030
+ $ref: '#/components/schemas/User',
1031
+ },
1032
+ },
1033
+ },
1034
+ description: 'Updated user object',
1035
+ required: true,
1036
+ },
1037
+ },
1038
+ delete: {
1039
+ tags: ['user'],
1040
+ summary: 'Delete user',
1041
+ description: 'This can only be done by the logged in user.',
1042
+ operationId: 'deleteUser',
1043
+ parameters: [
1044
+ {
1045
+ name: 'username',
1046
+ in: 'path',
1047
+ description: 'The name that needs to be deleted',
1048
+ required: true,
1049
+ schema: {
1050
+ type: 'string',
1051
+ },
1052
+ },
1053
+ ],
1054
+ responses: {
1055
+ '400': {
1056
+ description: 'Invalid username supplied',
1057
+ },
1058
+ '404': {
1059
+ description: 'User not found',
1060
+ },
1061
+ },
1062
+ },
1063
+ },
1064
+ '/user/createWithArray': {
1065
+ post: {
1066
+ tags: ['user'],
1067
+ summary: 'Creates list of users with given input array',
1068
+ description: '',
1069
+ operationId: 'createUsersWithArrayInput',
1070
+ responses: {
1071
+ default: {
1072
+ description: 'successful operation',
1073
+ },
1074
+ },
1075
+ requestBody: {
1076
+ $ref: '#/components/requestBodies/UserArray',
1077
+ },
1078
+ },
1079
+ },
1080
+ '/user/createWithList': {
1081
+ post: {
1082
+ tags: ['user'],
1083
+ summary: 'Creates list of users with given input array',
1084
+ description: '',
1085
+ operationId: 'createUsersWithListInput',
1086
+ responses: {
1087
+ default: {
1088
+ description: 'successful operation',
1089
+ },
1090
+ },
1091
+ requestBody: {
1092
+ $ref: '#/components/requestBodies/UserArray',
1093
+ },
1094
+ },
1095
+ },
1096
+ '/user/login': {
1097
+ get: {
1098
+ tags: ['user'],
1099
+ summary: 'Logs user into the system',
1100
+ description: '',
1101
+ operationId: 'loginUser',
1102
+ parameters: [
1103
+ {
1104
+ name: 'username',
1105
+ in: 'query',
1106
+ description: 'The user name for login',
1107
+ required: true,
1108
+ schema: {
1109
+ type: 'string',
1110
+ },
1111
+ },
1112
+ {
1113
+ name: 'password',
1114
+ in: 'query',
1115
+ description: 'The password for login in clear text',
1116
+ required: true,
1117
+ schema: {
1118
+ type: 'string',
1119
+ },
1120
+ },
1121
+ ],
1122
+ responses: {
1123
+ '200': {
1124
+ description: 'successful operation',
1125
+ headers: {
1126
+ 'X-Rate-Limit': {
1127
+ description: 'calls per hour allowed by the user',
1128
+ schema: {
1129
+ type: 'integer',
1130
+ format: 'int32',
1131
+ },
1132
+ },
1133
+ 'X-Expires-After': {
1134
+ description: 'date in UTC when token expires',
1135
+ schema: {
1136
+ type: 'string',
1137
+ format: 'date-time',
1138
+ },
1139
+ },
1140
+ },
1141
+ content: {
1142
+ 'application/json': {
1143
+ schema: {
1144
+ type: 'string',
1145
+ },
1146
+ examples: {
1147
+ response: {
1148
+ value: 'OK',
1149
+ },
1150
+ },
1151
+ },
1152
+ 'application/xml': {
1153
+ schema: {
1154
+ type: 'string',
1155
+ },
1156
+ examples: {
1157
+ response: {
1158
+ value: '<Message> OK </Message>',
1159
+ },
1160
+ },
1161
+ },
1162
+ 'text/plain': {
1163
+ examples: {
1164
+ response: {
1165
+ value: 'OK',
1166
+ },
1167
+ },
1168
+ },
1169
+ },
1170
+ },
1171
+ '400': {
1172
+ description: 'Invalid username/password supplied',
1173
+ },
1174
+ },
1175
+ },
1176
+ },
1177
+ '/user/logout': {
1178
+ get: {
1179
+ tags: ['user'],
1180
+ summary: 'Logs out current logged in user session',
1181
+ description: '',
1182
+ operationId: 'logoutUser',
1183
+ responses: {
1184
+ default: {
1185
+ description: 'successful operation',
1186
+ },
1187
+ },
1188
+ },
1189
+ },
1190
+ },
1191
+ components: {
1192
+ schemas: {
1193
+ ApiResponse: {
1194
+ type: 'object',
1195
+ properties: {
1196
+ code: {
1197
+ type: 'integer',
1198
+ format: 'int32',
1199
+ },
1200
+ type: {
1201
+ type: 'string',
1202
+ },
1203
+ message: {
1204
+ type: 'string',
1205
+ },
1206
+ },
1207
+ },
1208
+ Cat: {
1209
+ description: 'A representation of a cat',
1210
+ allOf: [
1211
+ {
1212
+ $ref: '#/components/schemas/Pet',
1213
+ },
1214
+ {
1215
+ type: 'object',
1216
+ properties: {
1217
+ huntingSkill: {
1218
+ type: 'string',
1219
+ description: 'The measured skill for hunting',
1220
+ default: 'lazy',
1221
+ example: 'adventurous',
1222
+ enum: ['clueless', 'lazy', 'adventurous', 'aggressive'],
1223
+ },
1224
+ },
1225
+ required: ['huntingSkill'],
1226
+ },
1227
+ ],
1228
+ },
1229
+ Category: {
1230
+ type: 'object',
1231
+ properties: {
1232
+ id: {
1233
+ description: 'Category ID',
1234
+ allOf: [
1235
+ {
1236
+ $ref: '#/components/schemas/Id',
1237
+ },
1238
+ ],
1239
+ },
1240
+ name: {
1241
+ description: 'Category name',
1242
+ type: 'string',
1243
+ minLength: 1,
1244
+ },
1245
+ sub: {
1246
+ description: 'Test Sub Category',
1247
+ type: 'object',
1248
+ properties: {
1249
+ prop1: {
1250
+ type: 'string',
1251
+ description: 'Dumb Property',
1252
+ },
1253
+ },
1254
+ },
1255
+ },
1256
+ xml: {
1257
+ name: 'Category',
1258
+ },
1259
+ },
1260
+ Dog: {
1261
+ description: 'A representation of a dog',
1262
+ allOf: [
1263
+ {
1264
+ $ref: '#/components/schemas/Pet',
1265
+ },
1266
+ {
1267
+ type: 'object',
1268
+ properties: {
1269
+ packSize: {
1270
+ type: 'integer',
1271
+ format: 'int32',
1272
+ description: 'The size of the pack the dog is from',
1273
+ default: 1,
1274
+ minimum: 1,
1275
+ },
1276
+ },
1277
+ required: ['packSize'],
1278
+ },
1279
+ ],
1280
+ },
1281
+ HoneyBee: {
1282
+ description: 'A representation of a honey bee',
1283
+ allOf: [
1284
+ {
1285
+ $ref: '#/components/schemas/Pet',
1286
+ },
1287
+ {
1288
+ type: 'object',
1289
+ properties: {
1290
+ honeyPerDay: {
1291
+ type: 'number',
1292
+ description: 'Average amount of honey produced per day in ounces',
1293
+ example: 3.14,
1294
+ multipleOf: 0.01,
1295
+ },
1296
+ },
1297
+ required: ['honeyPerDay'],
1298
+ },
1299
+ ],
1300
+ },
1301
+ Id: {
1302
+ type: 'integer',
1303
+ format: 'int64',
1304
+ readOnly: true,
1305
+ },
1306
+ Order: {
1307
+ type: 'object',
1308
+ properties: {
1309
+ id: {
1310
+ description: 'Order ID',
1311
+ allOf: [
1312
+ {
1313
+ $ref: '#/components/schemas/Id',
1314
+ },
1315
+ ],
1316
+ },
1317
+ petId: {
1318
+ description: 'Pet ID',
1319
+ allOf: [
1320
+ {
1321
+ $ref: '#/components/schemas/Id',
1322
+ },
1323
+ ],
1324
+ },
1325
+ quantity: {
1326
+ type: 'integer',
1327
+ format: 'int32',
1328
+ minimum: 1,
1329
+ default: 1,
1330
+ },
1331
+ shipDate: {
1332
+ description: 'Estimated ship date',
1333
+ type: 'string',
1334
+ format: 'date-time',
1335
+ },
1336
+ status: {
1337
+ type: 'string',
1338
+ description: 'Order Status',
1339
+ enum: ['placed', 'approved', 'delivered'],
1340
+ },
1341
+ complete: {
1342
+ description: 'Indicates whenever order was completed or not',
1343
+ type: 'boolean',
1344
+ default: false,
1345
+ readOnly: true,
1346
+ },
1347
+ requestId: {
1348
+ description: 'Unique Request Id',
1349
+ type: 'string',
1350
+ writeOnly: true,
1351
+ },
1352
+ },
1353
+ xml: {
1354
+ name: 'Order',
1355
+ },
1356
+ },
1357
+ Pet: {
1358
+ type: 'object',
1359
+ required: ['name', 'photoUrls'],
1360
+ discriminator: {
1361
+ propertyName: 'petType',
1362
+ mapping: {
1363
+ cat: '#/components/schemas/Cat',
1364
+ dog: '#/components/schemas/Dog',
1365
+ bee: '#/components/schemas/HoneyBee',
1366
+ },
1367
+ },
1368
+ properties: {
1369
+ id: {
1370
+ externalDocs: {
1371
+ description: 'Find more info here',
1372
+ url: 'https://example.com',
1373
+ },
1374
+ description: 'Pet ID',
1375
+ allOf: [
1376
+ {
1377
+ $ref: '#/components/schemas/Id',
1378
+ },
1379
+ ],
1380
+ },
1381
+ category: {
1382
+ description: 'Categories this pet belongs to',
1383
+ allOf: [
1384
+ {
1385
+ $ref: '#/components/schemas/Category',
1386
+ },
1387
+ ],
1388
+ },
1389
+ name: {
1390
+ description: 'The name given to a pet',
1391
+ type: 'string',
1392
+ example: 'Guru',
1393
+ },
1394
+ photoUrls: {
1395
+ description: 'The list of URL to a cute photos featuring pet',
1396
+ type: 'array',
1397
+ maxItems: 20,
1398
+ xml: {
1399
+ name: 'photoUrl',
1400
+ wrapped: true,
1401
+ },
1402
+ items: {
1403
+ type: 'string',
1404
+ format: 'url',
1405
+ },
1406
+ },
1407
+ friend: {
1408
+ allOf: [
1409
+ {
1410
+ $ref: '#/components/schemas/Pet',
1411
+ },
1412
+ ],
1413
+ },
1414
+ tags: {
1415
+ description: 'Tags attached to the pet',
1416
+ type: 'array',
1417
+ minItems: 1,
1418
+ xml: {
1419
+ name: 'tag',
1420
+ wrapped: true,
1421
+ },
1422
+ items: {
1423
+ $ref: '#/components/schemas/Tag',
1424
+ },
1425
+ },
1426
+ status: {
1427
+ type: 'string',
1428
+ description: 'Pet status in the store',
1429
+ enum: ['available', 'pending', 'sold'],
1430
+ },
1431
+ petType: {
1432
+ description: 'Type of a pet',
1433
+ type: 'string',
1434
+ },
1435
+ },
1436
+ xml: {
1437
+ name: 'Pet',
1438
+ },
1439
+ },
1440
+ Tag: {
1441
+ type: 'object',
1442
+ properties: {
1443
+ id: {
1444
+ description: 'Tag ID',
1445
+ allOf: [
1446
+ {
1447
+ $ref: '#/components/schemas/Id',
1448
+ },
1449
+ ],
1450
+ },
1451
+ name: {
1452
+ description: 'Tag name',
1453
+ type: 'string',
1454
+ minLength: 1,
1455
+ },
1456
+ },
1457
+ xml: {
1458
+ name: 'Tag',
1459
+ },
1460
+ },
1461
+ User: {
1462
+ type: 'object',
1463
+ properties: {
1464
+ id: {
1465
+ $ref: '#/components/schemas/Id',
1466
+ },
1467
+ pet: {
1468
+ oneOf: [
1469
+ {
1470
+ $ref: '#/components/schemas/Pet',
1471
+ },
1472
+ {
1473
+ $ref: '#/components/schemas/Tag',
1474
+ },
1475
+ ],
1476
+ },
1477
+ username: {
1478
+ description: 'User supplied username',
1479
+ type: 'string',
1480
+ minLength: 4,
1481
+ example: 'John78',
1482
+ },
1483
+ firstName: {
1484
+ description: 'User first name',
1485
+ type: 'string',
1486
+ minLength: 1,
1487
+ example: 'John',
1488
+ },
1489
+ lastName: {
1490
+ description: 'User last name',
1491
+ type: 'string',
1492
+ minLength: 1,
1493
+ example: 'Smith',
1494
+ },
1495
+ email: {
1496
+ description: 'User email address',
1497
+ type: 'string',
1498
+ format: 'email',
1499
+ example: 'john.smith@example.com',
1500
+ },
1501
+ password: {
1502
+ type: 'string',
1503
+ description: 'User password, MUST contain a mix of upper and lower case letters, as well as digits',
1504
+ format: 'password',
1505
+ minLength: 8,
1506
+ pattern: '/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])/',
1507
+ example: 'drowssaP123',
1508
+ },
1509
+ phone: {
1510
+ description: 'User phone number in international format',
1511
+ type: 'string',
1512
+ pattern: '/^\\+(?:[0-9]-?){6,14}[0-9]$/',
1513
+ example: '+1-202-555-0192',
1514
+ },
1515
+ userStatus: {
1516
+ description: 'User status',
1517
+ type: 'integer',
1518
+ format: 'int32',
1519
+ },
1520
+ },
1521
+ xml: {
1522
+ name: 'User',
1523
+ },
1524
+ },
1525
+ },
1526
+ requestBodies: {
1527
+ Pet: {
1528
+ content: {
1529
+ 'application/json': {
1530
+ schema: {
1531
+ allOf: [
1532
+ {
1533
+ description: 'My Pet',
1534
+ title: 'Pettie',
1535
+ },
1536
+ {
1537
+ $ref: '#/components/schemas/Pet',
1538
+ },
1539
+ ],
1540
+ },
1541
+ },
1542
+ 'application/xml': {
1543
+ schema: {
1544
+ type: 'object',
1545
+ properties: {
1546
+ name: {
1547
+ type: 'string',
1548
+ description: 'hooray',
1549
+ },
1550
+ },
1551
+ },
1552
+ },
1553
+ },
1554
+ description: 'Pet object that needs to be added to the store',
1555
+ required: true,
1556
+ },
1557
+ UserArray: {
1558
+ content: {
1559
+ 'application/json': {
1560
+ schema: {
1561
+ type: 'array',
1562
+ items: {
1563
+ $ref: '#/components/schemas/User',
1564
+ },
1565
+ },
1566
+ },
1567
+ },
1568
+ description: 'List of user object',
1569
+ required: true,
1570
+ },
1571
+ },
1572
+ securitySchemes: {
1573
+ petstore_auth: {
1574
+ description: 'Get access to data while protecting your account credentials.\nOAuth2 is also a safer and more secure way to give you access.\n',
1575
+ type: 'oauth2',
1576
+ flows: {
1577
+ clientCredentials: {
1578
+ tokenUrl: 'http://petstore.swagger.io/api/oauth/dialog',
1579
+ scopes: {
1580
+ 'write:pets': 'modify pets in your account',
1581
+ 'read:pets': 'read your pets',
1582
+ },
1583
+ },
1584
+ },
1585
+ },
1586
+ api_key: {
1587
+ description: 'For this sample, you can use the api key `special-key` to test the authorization filters.\n',
1588
+ type: 'apiKey',
1589
+ name: 'api_key',
1590
+ in: 'header',
1591
+ },
1592
+ },
1593
+ examples: {
1594
+ Order: {
1595
+ value: {
1596
+ quantity: 1,
1597
+ shipDate: '2018-10-19T16:46:45Z',
1598
+ status: 'placed',
1599
+ complete: false,
1600
+ },
1601
+ },
1602
+ },
1603
+ },
1604
+ 'x-webhooks': {
1605
+ newPet: {
1606
+ post: {
1607
+ summary: 'New pet',
1608
+ description: 'Information about a new pet in the systems',
1609
+ operationId: 'newPet',
1610
+ tags: ['pet'],
1611
+ requestBody: {
1612
+ content: {
1613
+ 'application/json': {
1614
+ schema: {
1615
+ $ref: '#/components/schemas/Pet',
1616
+ },
1617
+ },
1618
+ },
1619
+ },
1620
+ responses: {
1621
+ '200': {
1622
+ description: 'Return a 200 status to indicate that the data was received successfully',
1623
+ },
1624
+ },
1625
+ },
1626
+ },
1627
+ },
1628
+ };
1629
+ export const originalOptions = {
1630
+ withImports: true,
1631
+ withComments: false,
1632
+ skipOptionalParameters: false,
1633
+ withOAuth2Call: true,
1634
+ spec,
1635
+ };
1636
+ export const source = {
1637
+ ['POST http://petstore.swagger.io/v2/pet']: {
1638
+ method: 'post',
1639
+ url: 'http://petstore.swagger.io/v2/pet',
1640
+ httpVersion: 'HTTP/1.1',
1641
+ cookies: [
1642
+ {
1643
+ name: 'cookieParam',
1644
+ value: '0',
1645
+ },
1646
+ ],
1647
+ headers: [
1648
+ {
1649
+ name: 'Content-Type',
1650
+ value: 'application/json',
1651
+ },
1652
+ {
1653
+ name: 'Accept-Language',
1654
+ value: 'en-AU',
1655
+ },
1656
+ {
1657
+ name: 'Authorization',
1658
+ value: 'Bearer <YOUR_TOKEN_HERE>',
1659
+ },
1660
+ ],
1661
+ queryString: [],
1662
+ postData: {
1663
+ mimeType: 'application/json',
1664
+ text: '{"category":{"name":"string","sub":{"prop1":"string"}},"name":"Guru","photoUrls":["string"],"friend":{},"tags":[{"name":"string"}],"status":"available","petType":"cat","huntingSkill":"adventurous"}',
1665
+ params: [],
1666
+ jsonObj: {
1667
+ category: {
1668
+ name: 'string',
1669
+ sub: {
1670
+ prop1: 'string',
1671
+ },
1672
+ },
1673
+ name: 'Guru',
1674
+ photoUrls: ['string'],
1675
+ friend: {},
1676
+ tags: [
1677
+ {
1678
+ name: 'string',
1679
+ },
1680
+ ],
1681
+ status: 'available',
1682
+ petType: 'cat',
1683
+ huntingSkill: 'adventurous',
1684
+ },
1685
+ },
1686
+ headersSize: 0,
1687
+ bodySize: 0,
1688
+ securityOAuth2ExtraCalls: [
1689
+ {
1690
+ method: 'POST',
1691
+ url: 'http://petstore.swagger.io/api/oauth/dialog',
1692
+ httpVersion: 'HTTP/1.1',
1693
+ headers: [
1694
+ {
1695
+ name: 'Content-Type',
1696
+ value: 'application/x-www-form-urlencoded',
1697
+ },
1698
+ {
1699
+ name: 'Accept',
1700
+ value: 'application/json',
1701
+ },
1702
+ ],
1703
+ queryString: [],
1704
+ postData: {
1705
+ mimeType: 'application/x-www-form-urlencoded',
1706
+ text: '',
1707
+ params: [
1708
+ {
1709
+ name: 'grant_type',
1710
+ value: 'client_credentials',
1711
+ },
1712
+ {
1713
+ name: 'client_id',
1714
+ value: 'YOUR_CLIENT_ID',
1715
+ },
1716
+ {
1717
+ name: 'client_secret',
1718
+ value: 'YOUR_CLIENT_SECRET',
1719
+ },
1720
+ {
1721
+ name: 'scope',
1722
+ value: 'write:pets read:pets',
1723
+ },
1724
+ ],
1725
+ },
1726
+ cookies: [],
1727
+ headersSize: -1,
1728
+ bodySize: -1,
1729
+ securityOAuth2ExtraCalls: [],
1730
+ },
1731
+ ],
1732
+ pathParameters: {},
1733
+ serverVariables: {},
1734
+ queryObj: {},
1735
+ headersObj: {
1736
+ 'Content-Type': 'application/json',
1737
+ 'Accept-Language': 'en-AU',
1738
+ Authorization: 'Bearer <YOUR_TOKEN_HERE>',
1739
+ },
1740
+ cookiesObj: {
1741
+ cookieParam: '0',
1742
+ },
1743
+ allHeaders: {
1744
+ cookie: 'cookieParam=0',
1745
+ 'Content-Type': 'application/json',
1746
+ 'Accept-Language': 'en-AU',
1747
+ Authorization: 'Bearer <YOUR_TOKEN_HERE>',
1748
+ },
1749
+ uriObj: {
1750
+ protocol: 'http:',
1751
+ slashes: true,
1752
+ auth: null,
1753
+ host: 'petstore.swagger.io',
1754
+ port: null,
1755
+ hostname: 'petstore.swagger.io',
1756
+ hash: null,
1757
+ search: '',
1758
+ query: {},
1759
+ pathname: '/v2/pet',
1760
+ path: '/v2/pet',
1761
+ href: 'http://petstore.swagger.io/v2/pet',
1762
+ },
1763
+ fullUrl: 'http://petstore.swagger.io/v2/pet',
1764
+ },
1765
+ ['POST http://petstore.swagger.io/v2/pet/{petId}/uploadImage/{data}']: {
1766
+ method: 'post',
1767
+ url: 'http://petstore.swagger.io/v2/pet/{petId}/uploadImage/{data}',
1768
+ httpVersion: 'HTTP/1.1',
1769
+ cookies: [],
1770
+ headers: [
1771
+ {
1772
+ name: 'Content-Type',
1773
+ value: 'application/octet-stream',
1774
+ },
1775
+ {
1776
+ name: 'Authorization',
1777
+ value: 'Bearer <YOUR_TOKEN_HERE>',
1778
+ },
1779
+ ],
1780
+ queryString: [],
1781
+ headersSize: 0,
1782
+ bodySize: 0,
1783
+ securityOAuth2ExtraCalls: [
1784
+ {
1785
+ method: 'POST',
1786
+ url: 'http://petstore.swagger.io/api/oauth/dialog',
1787
+ httpVersion: 'HTTP/1.1',
1788
+ headers: [
1789
+ {
1790
+ name: 'Content-Type',
1791
+ value: 'application/x-www-form-urlencoded',
1792
+ },
1793
+ {
1794
+ name: 'Accept',
1795
+ value: 'application/json',
1796
+ },
1797
+ ],
1798
+ queryString: [],
1799
+ postData: {
1800
+ mimeType: 'application/x-www-form-urlencoded',
1801
+ text: '',
1802
+ params: [
1803
+ {
1804
+ name: 'grant_type',
1805
+ value: 'client_credentials',
1806
+ },
1807
+ {
1808
+ name: 'client_id',
1809
+ value: 'YOUR_CLIENT_ID',
1810
+ },
1811
+ {
1812
+ name: 'client_secret',
1813
+ value: 'YOUR_CLIENT_SECRET',
1814
+ },
1815
+ {
1816
+ name: 'scope',
1817
+ value: 'write:pets read:pets',
1818
+ },
1819
+ ],
1820
+ },
1821
+ cookies: [],
1822
+ headersSize: -1,
1823
+ bodySize: -1,
1824
+ securityOAuth2ExtraCalls: [],
1825
+ },
1826
+ ],
1827
+ pathParameters: {
1828
+ petId: '',
1829
+ data: '',
1830
+ },
1831
+ serverVariables: {},
1832
+ queryObj: {},
1833
+ headersObj: {
1834
+ 'Content-Type': 'application/octet-stream',
1835
+ Authorization: 'Bearer <YOUR_TOKEN_HERE>',
1836
+ },
1837
+ cookiesObj: {},
1838
+ allHeaders: {
1839
+ 'Content-Type': 'application/octet-stream',
1840
+ Authorization: 'Bearer <YOUR_TOKEN_HERE>',
1841
+ },
1842
+ uriObj: {
1843
+ protocol: 'http:',
1844
+ slashes: true,
1845
+ auth: null,
1846
+ host: 'petstore.swagger.io',
1847
+ port: null,
1848
+ hostname: 'petstore.swagger.io',
1849
+ hash: null,
1850
+ search: '',
1851
+ query: {},
1852
+ pathname: '/v2/pet/{petId}/uploadImage/{data}',
1853
+ path: '/v2/pet/{petId}/uploadImage/{data}',
1854
+ href: 'http://petstore.swagger.io/v2/pet/{petId}/uploadImage/{data}',
1855
+ },
1856
+ fullUrl: 'http://petstore.swagger.io/v2/pet/{petId}/uploadImage/{data}',
1857
+ },
1858
+ ['PUT http://petstore.swagger.io/v2/pet']: {
1859
+ method: 'put',
1860
+ url: 'http://petstore.swagger.io/v2/pet',
1861
+ httpVersion: 'HTTP/1.1',
1862
+ cookies: [
1863
+ {
1864
+ name: 'cookieParam',
1865
+ value: '0',
1866
+ },
1867
+ ],
1868
+ headers: [
1869
+ {
1870
+ name: 'Content-Type',
1871
+ value: 'application/json',
1872
+ },
1873
+ {
1874
+ name: 'Accept-Language',
1875
+ value: 'en-AU',
1876
+ },
1877
+ {
1878
+ name: 'Authorization',
1879
+ value: 'Bearer <YOUR_TOKEN_HERE>',
1880
+ },
1881
+ ],
1882
+ queryString: [],
1883
+ postData: {
1884
+ mimeType: 'application/json',
1885
+ text: '{"category":{"name":"string","sub":{"prop1":"string"}},"name":"Guru","photoUrls":["string"],"friend":{},"tags":[{"name":"string"}],"status":"available","petType":"cat","huntingSkill":"adventurous"}',
1886
+ params: [],
1887
+ jsonObj: {
1888
+ category: {
1889
+ name: 'string',
1890
+ sub: {
1891
+ prop1: 'string',
1892
+ },
1893
+ },
1894
+ name: 'Guru',
1895
+ photoUrls: ['string'],
1896
+ friend: {},
1897
+ tags: [
1898
+ {
1899
+ name: 'string',
1900
+ },
1901
+ ],
1902
+ status: 'available',
1903
+ petType: 'cat',
1904
+ huntingSkill: 'adventurous',
1905
+ },
1906
+ },
1907
+ headersSize: 0,
1908
+ bodySize: 0,
1909
+ securityOAuth2ExtraCalls: [
1910
+ {
1911
+ method: 'POST',
1912
+ url: 'http://petstore.swagger.io/api/oauth/dialog',
1913
+ httpVersion: 'HTTP/1.1',
1914
+ headers: [
1915
+ {
1916
+ name: 'Content-Type',
1917
+ value: 'application/x-www-form-urlencoded',
1918
+ },
1919
+ {
1920
+ name: 'Accept',
1921
+ value: 'application/json',
1922
+ },
1923
+ ],
1924
+ queryString: [],
1925
+ postData: {
1926
+ mimeType: 'application/x-www-form-urlencoded',
1927
+ text: '',
1928
+ params: [
1929
+ {
1930
+ name: 'grant_type',
1931
+ value: 'client_credentials',
1932
+ },
1933
+ {
1934
+ name: 'client_id',
1935
+ value: 'YOUR_CLIENT_ID',
1936
+ },
1937
+ {
1938
+ name: 'client_secret',
1939
+ value: 'YOUR_CLIENT_SECRET',
1940
+ },
1941
+ {
1942
+ name: 'scope',
1943
+ value: 'write:pets read:pets',
1944
+ },
1945
+ ],
1946
+ },
1947
+ cookies: [],
1948
+ headersSize: -1,
1949
+ bodySize: -1,
1950
+ securityOAuth2ExtraCalls: [],
1951
+ },
1952
+ ],
1953
+ pathParameters: {},
1954
+ serverVariables: {},
1955
+ queryObj: {},
1956
+ headersObj: {
1957
+ 'Content-Type': 'application/json',
1958
+ 'Accept-Language': 'en-AU',
1959
+ Authorization: 'Bearer <YOUR_TOKEN_HERE>',
1960
+ },
1961
+ cookiesObj: {
1962
+ cookieParam: '0',
1963
+ },
1964
+ allHeaders: {
1965
+ cookie: 'cookieParam=0',
1966
+ 'Content-Type': 'application/json',
1967
+ 'Accept-Language': 'en-AU',
1968
+ Authorization: 'Bearer <YOUR_TOKEN_HERE>',
1969
+ },
1970
+ uriObj: {
1971
+ protocol: 'http:',
1972
+ slashes: true,
1973
+ auth: null,
1974
+ host: 'petstore.swagger.io',
1975
+ port: null,
1976
+ hostname: 'petstore.swagger.io',
1977
+ hash: null,
1978
+ search: '',
1979
+ query: {},
1980
+ pathname: '/v2/pet',
1981
+ path: '/v2/pet',
1982
+ href: 'http://petstore.swagger.io/v2/pet',
1983
+ },
1984
+ fullUrl: 'http://petstore.swagger.io/v2/pet',
1985
+ },
1986
+ ['POST http://petstore.swagger.io/v2/pet/{petId}/uploadImage']: {
1987
+ method: 'post',
1988
+ url: 'http://petstore.swagger.io/v2/pet/{petId}/uploadImage',
1989
+ httpVersion: 'HTTP/1.1',
1990
+ cookies: [],
1991
+ headers: [
1992
+ {
1993
+ name: 'Content-Type',
1994
+ value: 'application/octet-stream',
1995
+ },
1996
+ {
1997
+ name: 'Authorization',
1998
+ value: 'Bearer <YOUR_TOKEN_HERE>',
1999
+ },
2000
+ ],
2001
+ queryString: [],
2002
+ headersSize: 0,
2003
+ bodySize: 0,
2004
+ securityOAuth2ExtraCalls: [
2005
+ {
2006
+ method: 'POST',
2007
+ url: 'http://petstore.swagger.io/api/oauth/dialog',
2008
+ httpVersion: 'HTTP/1.1',
2009
+ headers: [
2010
+ {
2011
+ name: 'Content-Type',
2012
+ value: 'application/x-www-form-urlencoded',
2013
+ },
2014
+ {
2015
+ name: 'Accept',
2016
+ value: 'application/json',
2017
+ },
2018
+ ],
2019
+ queryString: [],
2020
+ postData: {
2021
+ mimeType: 'application/x-www-form-urlencoded',
2022
+ text: '',
2023
+ params: [
2024
+ {
2025
+ name: 'grant_type',
2026
+ value: 'client_credentials',
2027
+ },
2028
+ {
2029
+ name: 'client_id',
2030
+ value: 'YOUR_CLIENT_ID',
2031
+ },
2032
+ {
2033
+ name: 'client_secret',
2034
+ value: 'YOUR_CLIENT_SECRET',
2035
+ },
2036
+ {
2037
+ name: 'scope',
2038
+ value: 'write:pets read:pets',
2039
+ },
2040
+ ],
2041
+ },
2042
+ cookies: [],
2043
+ headersSize: -1,
2044
+ bodySize: -1,
2045
+ securityOAuth2ExtraCalls: [],
2046
+ },
2047
+ ],
2048
+ pathParameters: {
2049
+ petId: '',
2050
+ },
2051
+ serverVariables: {},
2052
+ queryObj: {},
2053
+ headersObj: {
2054
+ 'Content-Type': 'application/octet-stream',
2055
+ Authorization: 'Bearer <YOUR_TOKEN_HERE>',
2056
+ },
2057
+ cookiesObj: {},
2058
+ allHeaders: {
2059
+ 'Content-Type': 'application/octet-stream',
2060
+ Authorization: 'Bearer <YOUR_TOKEN_HERE>',
2061
+ },
2062
+ uriObj: {
2063
+ protocol: 'http:',
2064
+ slashes: true,
2065
+ auth: null,
2066
+ host: 'petstore.swagger.io',
2067
+ port: null,
2068
+ hostname: 'petstore.swagger.io',
2069
+ hash: null,
2070
+ search: '',
2071
+ query: {},
2072
+ pathname: '/v2/pet/{petId}/uploadImage',
2073
+ path: '/v2/pet/{petId}/uploadImage',
2074
+ href: 'http://petstore.swagger.io/v2/pet/{petId}/uploadImage',
2075
+ },
2076
+ fullUrl: 'http://petstore.swagger.io/v2/pet/{petId}/uploadImage',
2077
+ },
2078
+ ['GET http://petstore.swagger.io/v2/pet/findByStatus/{id}']: {
2079
+ method: 'get',
2080
+ url: 'http://petstore.swagger.io/v2/pet/findByStatus/{id}',
2081
+ httpVersion: 'HTTP/1.1',
2082
+ cookies: [],
2083
+ headers: [
2084
+ {
2085
+ name: 'Authorization',
2086
+ value: 'Bearer <YOUR_TOKEN_HERE>',
2087
+ },
2088
+ ],
2089
+ queryString: [
2090
+ {
2091
+ name: 'status',
2092
+ value: 'available',
2093
+ },
2094
+ ],
2095
+ headersSize: 0,
2096
+ bodySize: 0,
2097
+ securityOAuth2ExtraCalls: [
2098
+ {
2099
+ method: 'POST',
2100
+ url: 'http://petstore.swagger.io/api/oauth/dialog',
2101
+ httpVersion: 'HTTP/1.1',
2102
+ headers: [
2103
+ {
2104
+ name: 'Content-Type',
2105
+ value: 'application/x-www-form-urlencoded',
2106
+ },
2107
+ {
2108
+ name: 'Accept',
2109
+ value: 'application/json',
2110
+ },
2111
+ ],
2112
+ queryString: [],
2113
+ postData: {
2114
+ mimeType: 'application/x-www-form-urlencoded',
2115
+ text: '',
2116
+ params: [
2117
+ {
2118
+ name: 'grant_type',
2119
+ value: 'client_credentials',
2120
+ },
2121
+ {
2122
+ name: 'client_id',
2123
+ value: 'YOUR_CLIENT_ID',
2124
+ },
2125
+ {
2126
+ name: 'client_secret',
2127
+ value: 'YOUR_CLIENT_SECRET',
2128
+ },
2129
+ {
2130
+ name: 'scope',
2131
+ value: 'write:pets read:pets',
2132
+ },
2133
+ ],
2134
+ },
2135
+ cookies: [],
2136
+ headersSize: -1,
2137
+ bodySize: -1,
2138
+ securityOAuth2ExtraCalls: [],
2139
+ },
2140
+ ],
2141
+ pathParameters: {
2142
+ id: '',
2143
+ },
2144
+ serverVariables: {},
2145
+ queryObj: {
2146
+ status: 'available',
2147
+ },
2148
+ headersObj: {
2149
+ Authorization: 'Bearer <YOUR_TOKEN_HERE>',
2150
+ },
2151
+ cookiesObj: {},
2152
+ allHeaders: {
2153
+ Authorization: 'Bearer <YOUR_TOKEN_HERE>',
2154
+ },
2155
+ uriObj: {
2156
+ protocol: 'http:',
2157
+ slashes: true,
2158
+ auth: null,
2159
+ host: 'petstore.swagger.io',
2160
+ port: null,
2161
+ hostname: 'petstore.swagger.io',
2162
+ hash: null,
2163
+ search: 'status=available',
2164
+ query: {
2165
+ status: 'available',
2166
+ },
2167
+ pathname: '/v2/pet/findByStatus/{id}',
2168
+ path: '/v2/pet/findByStatus/{id}?status=available',
2169
+ href: 'http://petstore.swagger.io/v2/pet/findByStatus/%7Bid%7D',
2170
+ },
2171
+ fullUrl: 'http://petstore.swagger.io/v2/pet/findByStatus/{id}?status=available',
2172
+ },
2173
+ ['POST https://{customerId}.saas-app.com:{port}/v2']: {
2174
+ method: 'post',
2175
+ url: 'https://{customerId}.saas-app.com:{port}/v2/pet',
2176
+ httpVersion: 'HTTP/1.1',
2177
+ cookies: [{ name: 'cookieParam', value: '0' }],
2178
+ headers: [
2179
+ { name: 'Content-Type', value: 'application/json' },
2180
+ { name: 'Accept-Language', value: 'en-AU' },
2181
+ { name: 'Authorization', value: 'Bearer <YOUR_TOKEN_HERE>' },
2182
+ ],
2183
+ queryString: [],
2184
+ postData: {
2185
+ mimeType: 'application/json',
2186
+ text: 'text',
2187
+ params: [],
2188
+ jsonObj: {
2189
+ category: { name: 'string', sub: { prop1: 'string' } },
2190
+ name: 'Guru',
2191
+ photoUrls: ['string'],
2192
+ friend: {},
2193
+ tags: [{ name: 'string' }],
2194
+ cvv_check: 'string',
2195
+ status: 'available',
2196
+ petType: 'cat',
2197
+ huntingSkill: 'adventurous',
2198
+ },
2199
+ },
2200
+ headersSize: 0,
2201
+ bodySize: 0,
2202
+ securityOAuth2ExtraCalls: [],
2203
+ pathParameters: {},
2204
+ serverVariables: { customerId: 'demo', port: '443' },
2205
+ queryObj: {},
2206
+ headersObj: {
2207
+ 'Content-Type': 'application/json',
2208
+ 'Accept-Language': 'en-AU',
2209
+ Authorization: 'Bearer <YOUR_TOKEN_HERE>',
2210
+ },
2211
+ cookiesObj: { cookieParam: '0' },
2212
+ allHeaders: {
2213
+ cookie: 'cookieParam=0',
2214
+ 'Content-Type': 'application/json',
2215
+ 'Accept-Language': 'en-AU',
2216
+ Authorization: 'Bearer <YOUR_TOKEN_HERE>',
2217
+ },
2218
+ uriObj: {
2219
+ protocol: 'https:',
2220
+ slashes: true,
2221
+ auth: null,
2222
+ host: '',
2223
+ port: null,
2224
+ hostname: '',
2225
+ hash: null,
2226
+ search: '',
2227
+ query: {},
2228
+ pathname: '{customerId}.saas-app.com:{port}/v2/pet',
2229
+ path: '{customerId}.saas-app.com:{port}/v2/pet',
2230
+ href: 'https:///%7BcustomerId%7D.saas-app.com:%7Bport%7D/v2/pet',
2231
+ },
2232
+ fullUrl: 'https://{customerId}.saas-app.com:{port}/v2/pet',
2233
+ },
2234
+ ['POST http://petstore.swagger.io/login']: {
2235
+ method: 'post',
2236
+ url: 'http://petstore.swagger.io/login',
2237
+ httpVersion: 'HTTP/1.1',
2238
+ headers: [],
2239
+ queryString: [],
2240
+ postData: {
2241
+ mimeType: 'application/json',
2242
+ text: 'text',
2243
+ params: [],
2244
+ jsonObj: {},
2245
+ },
2246
+ basicAuth: { username: 'usernamestring', password: 'passwordstring' },
2247
+ headersSize: 0,
2248
+ bodySize: 0,
2249
+ securityOAuth2ExtraCalls: [],
2250
+ pathParameters: {},
2251
+ queryObj: {},
2252
+ headersObj: {},
2253
+ cookiesObj: {},
2254
+ allHeaders: {},
2255
+ serverVariables: {},
2256
+ cookies: [{ name: 'cookieParam', value: '0' }],
2257
+ uriObj: {
2258
+ protocol: 'https:',
2259
+ slashes: true,
2260
+ auth: null,
2261
+ host: '',
2262
+ port: null,
2263
+ hostname: '',
2264
+ hash: null,
2265
+ search: '',
2266
+ query: {},
2267
+ pathname: 'petstore.swagger.io/login',
2268
+ path: 'petstore.swagger.io/login',
2269
+ href: 'https://petstore.swagger.io/login',
2270
+ },
2271
+ fullUrl: 'https://petstore.swagger.io/login',
2272
+ },
2273
+ ['POST http://petstore.swagger.io/v2/uploadImage']: {
2274
+ httpVersion: 'HTTP/1.1',
2275
+ queryString: [],
2276
+ basicAuth: { username: 'usernamestring', password: 'passwordstring' },
2277
+ headersSize: 0,
2278
+ bodySize: 0,
2279
+ securityOAuth2ExtraCalls: [],
2280
+ pathParameters: {},
2281
+ queryObj: {},
2282
+ headersObj: {},
2283
+ cookiesObj: {},
2284
+ allHeaders: {},
2285
+ serverVariables: {},
2286
+ cookies: [{ name: 'cookieParam', value: '0' }],
2287
+ uriObj: {
2288
+ protocol: 'https:',
2289
+ slashes: true,
2290
+ auth: null,
2291
+ host: '',
2292
+ port: null,
2293
+ hostname: '',
2294
+ hash: null,
2295
+ search: '',
2296
+ query: {},
2297
+ pathname: 'petstore.swagger.io/login',
2298
+ path: 'petstore.swagger.io/login',
2299
+ href: 'https://petstore.swagger.io/login',
2300
+ },
2301
+ fullUrl: 'https://petstore.swagger.io/login',
2302
+ method: 'POST',
2303
+ url: 'http://petstore.swagger.io/v2/uploadImage',
2304
+ headers: [],
2305
+ postData: {
2306
+ mimeType: 'multipart/form-data',
2307
+ params: [
2308
+ { name: 'file', value: 'pet_image.png' },
2309
+ { name: 'description', value: 'Pet photo' },
2310
+ ],
2311
+ },
2312
+ },
2313
+ };
2314
+ export const serverVariablesOptions = {
2315
+ withImports: true,
2316
+ withComments: false,
2317
+ skipOptionalParameters: false,
2318
+ withOAuth2Call: true,
2319
+ spec: {
2320
+ ...spec,
2321
+ ...{
2322
+ servers: [
2323
+ {
2324
+ url: 'https://{customerId}.saas-app.com:{port}/v2',
2325
+ variables: {
2326
+ customerId: {
2327
+ default: 'demo',
2328
+ description: 'Customer ID assigned by the service provider',
2329
+ },
2330
+ port: {
2331
+ enum: ['443', '8443'],
2332
+ default: '443',
2333
+ },
2334
+ },
2335
+ },
2336
+ ],
2337
+ },
2338
+ },
2339
+ };
2340
+ //# sourceMappingURL=mock.js.map