@redocly/openapi-docs 3.24.0 → 3.24.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.
- package/dist/{redocly-openapi-docs.min.AiChatProvider-CIrPFbvX.js → redocly-openapi-docs.min.AiChatProvider-j-VDfFJ9.js} +1 -1
- package/dist/{redocly-openapi-docs.min.AiChatSqliteDBStorage-eAy3scC4.js → redocly-openapi-docs.min.AiChatSqliteDBStorage-BBRBmffc.js} +1 -1
- package/dist/{redocly-openapi-docs.min.AiPanel-C6CGDyzy.js → redocly-openapi-docs.min.AiPanel-DTzHqAiI.js} +1 -1
- package/dist/{redocly-openapi-docs.min.FileWatcher-dIKl80Ec.js → redocly-openapi-docs.min.FileWatcher-DDoyaS7A.js} +1 -1
- package/dist/{redocly-openapi-docs.min.SemanticSearchService-D4V6-td8.js → redocly-openapi-docs.min.SemanticSearchService-DNFOPBZK.js} +1 -1
- package/dist/{redocly-openapi-docs.min.SqliteDBStorage-D9-Rb-N7.js → redocly-openapi-docs.min.SqliteDBStorage-Dy40Vq04.js} +1 -1
- package/dist/{redocly-openapi-docs.min.TauriFileSystemAdapter-CHW6hO3z.js → redocly-openapi-docs.min.TauriFileSystemAdapter-CpViFqJQ.js} +1 -1
- package/dist/{redocly-openapi-docs.min.TauriRootStorage-CHiKNUn2.js → redocly-openapi-docs.min.TauriRootStorage-TCUrp2uB.js} +1 -1
- package/dist/{redocly-openapi-docs.min.ai-chat-mappers-C19k85fj.js → redocly-openapi-docs.min.ai-chat-mappers-CmX-8902.js} +1 -1
- package/dist/{redocly-openapi-docs.min.external-resolver-BH7DBWU-.js → redocly-openapi-docs.min.external-resolver-BkceRyB4.js} +1 -1
- package/dist/{redocly-openapi-docs.min.index-BQp5pipW.js → redocly-openapi-docs.min.index-BCcol5vU.js} +1 -1
- package/dist/{redocly-openapi-docs.min.index-dirYvuKs.js → redocly-openapi-docs.min.index-C6uU_v-b.js} +1 -1
- package/dist/{redocly-openapi-docs.min.index-BuFUmOUm.js → redocly-openapi-docs.min.index-CmXZfuiZ.js} +11 -11
- package/dist/{redocly-openapi-docs.min.index-DLlCa16R.js → redocly-openapi-docs.min.index-DVWw0ICA.js} +1 -1
- package/dist/redocly-openapi-docs.min.js +1 -1
- package/dist/{redocly-openapi-docs.min.lint-Xu623Q1T.js → redocly-openapi-docs.min.lint-2YpbCz3r.js} +2 -2
- package/dist/{redocly-openapi-docs.min.lint-graphql-D-Nm5P1M.js → redocly-openapi-docs.min.lint-graphql-Bgfcu2tP.js} +1 -1
- package/dist/{redocly-openapi-docs.min.respect-run-CWNqYysq.js → redocly-openapi-docs.min.respect-run-Ct8taisL.js} +1 -1
- package/dist/{redocly-openapi-docs.min.standalone-CRo0Sa5b.js → redocly-openapi-docs.min.standalone-BPCdJgtH.js} +3 -3
- package/dist/{redocly-openapi-docs.min.tauri-path-BUSVirPk.js → redocly-openapi-docs.min.tauri-path-CmqBCxGb.js} +1 -1
- package/dist/{redocly-openapi-docs.min.useAiChatQueries-CXyQzME7.js → redocly-openapi-docs.min.useAiChatQueries-t8oy8jik.js} +2 -2
- package/lib/components/ApiInfo/__tests__/ApiInfo.test.d.ts +1 -0
- package/lib/components/ApiInfo/__tests__/ApiInfo.test.js +46 -0
- package/lib/components/Callbacks/__tests__/Callbacks.test.d.ts +1 -0
- package/lib/components/Callbacks/__tests__/Callbacks.test.js +46 -0
- package/lib/components/Content/__tests__/useAutoScroll.test.d.ts +1 -0
- package/lib/components/Content/__tests__/useAutoScroll.test.js +88 -0
- package/lib/components/ContentItem/__tests__/useIsExpanded.test.d.ts +1 -0
- package/lib/components/ContentItem/__tests__/useIsExpanded.test.js +123 -0
- package/lib/components/ContentItems/__tests__/Items.test.d.ts +1 -0
- package/lib/components/ContentItems/__tests__/Items.test.js +66 -0
- package/lib/components/ContentItems/__tests__/VirtualList.test.d.ts +1 -0
- package/lib/components/ContentItems/__tests__/VirtualList.test.js +135 -0
- package/lib/components/Discriminator/__tests__/DiscriminatorDropdown.test.d.ts +1 -0
- package/lib/components/Discriminator/__tests__/DiscriminatorDropdown.test.js +63 -0
- package/lib/components/Download/__tests__/DownloadSpecification.test.d.ts +1 -0
- package/lib/components/Download/__tests__/DownloadSpecification.test.js +52 -0
- package/lib/components/ExpandAllButton/__tests__/ExpandAllButton.test.d.ts +1 -0
- package/lib/components/ExpandAllButton/__tests__/ExpandAllButton.test.js +60 -0
- package/lib/components/ExpandAllButton/__tests__/helpers.test.d.ts +1 -0
- package/lib/components/ExpandAllButton/__tests__/helpers.test.js +133 -0
- package/lib/components/Language/__tests__/LanguageDropdown.test.d.ts +1 -0
- package/lib/components/Language/__tests__/LanguageDropdown.test.js +23 -0
- package/lib/components/Markdown/__tests__/Markdown.test.d.ts +1 -0
- package/lib/components/Markdown/__tests__/Markdown.test.js +34 -0
- package/lib/components/McpOverview/__tests__/McpOverview.test.d.ts +1 -0
- package/lib/components/McpOverview/__tests__/McpOverview.test.js +66 -0
- package/lib/components/McpTool/__tests__/McpPrompt.test.d.ts +1 -0
- package/lib/components/McpTool/__tests__/McpPrompt.test.js +57 -0
- package/lib/components/McpTool/__tests__/McpResource.test.d.ts +1 -0
- package/lib/components/McpTool/__tests__/McpResource.test.js +81 -0
- package/lib/components/McpTool/__tests__/McpTool.test.d.ts +1 -0
- package/lib/components/McpTool/__tests__/McpTool.test.js +82 -0
- package/lib/components/MediaTypeSwitch/__tests__/MediaTypesSwitch.test.d.ts +1 -0
- package/lib/components/MediaTypeSwitch/__tests__/MediaTypesSwitch.test.js +79 -0
- package/lib/components/OperationItem/__tests__/OperationItem.test.d.ts +1 -0
- package/lib/components/OperationItem/__tests__/OperationItem.test.js +70 -0
- package/lib/components/OperationItem/__tests__/__mocks__/mock-intersection-observer.d.ts +16 -0
- package/lib/components/OperationItem/__tests__/__mocks__/mock-intersection-observer.js +42 -0
- package/lib/components/Overview/__tests__/Overview.test.d.ts +1 -0
- package/lib/components/Overview/__tests__/Overview.test.js +59 -0
- package/lib/components/PayloadSamples/__tests__/Example.test.d.ts +1 -0
- package/lib/components/PayloadSamples/__tests__/Example.test.js +36 -0
- package/lib/components/PayloadSamples/__tests__/ExampleValue.test.d.ts +1 -0
- package/lib/components/PayloadSamples/__tests__/ExampleValue.test.js +197 -0
- package/lib/components/PayloadSamples/__tests__/PayloadSamples.test.d.ts +1 -0
- package/lib/components/PayloadSamples/__tests__/PayloadSamples.test.js +38 -0
- package/lib/components/PropertyDetails/__tests__/Extensions.test.d.ts +1 -0
- package/lib/components/PropertyDetails/__tests__/Extensions.test.js +21 -0
- package/lib/components/PropertyDetails/__tests__/FieldDetail.test.d.ts +1 -0
- package/lib/components/PropertyDetails/__tests__/FieldDetail.test.js +52 -0
- package/lib/components/PropertyDetails/__tests__/FieldDetails.test.d.ts +1 -0
- package/lib/components/PropertyDetails/__tests__/FieldDetails.test.js +191 -0
- package/lib/components/PropertyDetails/__tests__/PropertyDetails.test.d.ts +1 -0
- package/lib/components/PropertyDetails/__tests__/PropertyDetails.test.js +365 -0
- package/lib/components/PropertyDetails/__tests__/cycleColorsByLevel.test.d.ts +1 -0
- package/lib/components/PropertyDetails/__tests__/cycleColorsByLevel.test.js +23 -0
- package/lib/components/RedoclyOpenAPIDocs/__tests__/AppProvider.test.d.ts +1 -0
- package/lib/components/RedoclyOpenAPIDocs/__tests__/AppProvider.test.js +16 -0
- package/lib/components/RedoclyOpenAPIDocs/__tests__/RedoclyOpenAPIDocs.test.d.ts +1 -0
- package/lib/components/RedoclyOpenAPIDocs/__tests__/RedoclyOpenAPIDocs.test.js +104 -0
- package/lib/components/RenderHook/__tests__/RenderHook.test.d.ts +1 -0
- package/lib/components/RenderHook/__tests__/RenderHook.test.js +15 -0
- package/lib/components/Replay/__tests__/utils.test.d.ts +1 -0
- package/lib/components/Replay/__tests__/utils.test.js +526 -0
- package/lib/components/Request/__tests__/RequestDetails.test.d.ts +1 -0
- package/lib/components/Request/__tests__/RequestDetails.test.js +98 -0
- package/lib/components/RequestSamples/__tests__/Example.test.d.ts +1 -0
- package/lib/components/RequestSamples/__tests__/Example.test.js +384 -0
- package/lib/components/RequestSamples/__tests__/RequestSamples.test.d.ts +1 -0
- package/lib/components/RequestSamples/__tests__/RequestSamples.test.js +226 -0
- package/lib/components/RequestSamples/__tests__/useCodeSamples.test.d.ts +1 -0
- package/lib/components/RequestSamples/__tests__/useCodeSamples.test.js +64 -0
- package/lib/components/ResponseSamples/__tests__/ResponseSamples.test.d.ts +1 -0
- package/lib/components/ResponseSamples/__tests__/ResponseSamples.test.js +29 -0
- package/lib/components/Responses/__tests__/OperationResponseList.test.d.ts +1 -0
- package/lib/components/Responses/__tests__/OperationResponseList.test.js +89 -0
- package/lib/components/Responses/__tests__/ResponseDetails.test.d.ts +1 -0
- package/lib/components/Responses/__tests__/ResponseDetails.test.js +111 -0
- package/lib/components/Responses/__tests__/ResponsesHeaders.test.d.ts +1 -0
- package/lib/components/Responses/__tests__/ResponsesHeaders.test.js +26 -0
- package/lib/components/Schema/__tests__/ArraySchema.test.d.ts +1 -0
- package/lib/components/Schema/__tests__/ArraySchema.test.js +93 -0
- package/lib/components/Schema/__tests__/ObjectSchema.test.d.ts +1 -0
- package/lib/components/Schema/__tests__/ObjectSchema.test.js +115 -0
- package/lib/components/Schema/__tests__/OneOfSchema.test.d.ts +1 -0
- package/lib/components/Schema/__tests__/OneOfSchema.test.js +33 -0
- package/lib/components/Schema/__tests__/Schema.test.d.ts +1 -0
- package/lib/components/Schema/__tests__/Schema.test.js +67 -0
- package/lib/components/Schema/__tests__/useOneOfLocationIdx.test.d.ts +1 -0
- package/lib/components/Schema/__tests__/useOneOfLocationIdx.test.js +22 -0
- package/lib/components/SchemaCatalogLink/__tests__/SchemaCatalogLink.test.d.ts +1 -0
- package/lib/components/SchemaCatalogLink/__tests__/SchemaCatalogLink.test.js +95 -0
- package/lib/components/Security/__tests__/Security.test.d.ts +1 -0
- package/lib/components/Security/__tests__/Security.test.js +38 -0
- package/lib/components/Security/__tests__/SecurityButton.test.d.ts +1 -0
- package/lib/components/Security/__tests__/SecurityButton.test.js +92 -0
- package/lib/components/Security/__tests__/SecurityModal.test.d.ts +1 -0
- package/lib/components/Security/__tests__/SecurityModal.test.js +172 -0
- package/lib/components/ServerList/__tests__/ServerList.test.d.ts +1 -0
- package/lib/components/ServerList/__tests__/ServerList.test.js +83 -0
- package/lib/components/Tabs/__tests__/Tabs.test.d.ts +1 -0
- package/lib/components/Tabs/__tests__/Tabs.test.js +27 -0
- package/lib/components/ViewNested/__tests__/ViewNested.test.d.ts +1 -0
- package/lib/components/ViewNested/__tests__/ViewNested.test.js +42 -0
- package/lib/components/__tests__/Samples/ExampleSwitch.test.d.ts +1 -0
- package/lib/components/__tests__/Samples/ExampleSwitch.test.js +45 -0
- package/lib/components/__tests__/Samples/use-example-key.test.d.ts +1 -0
- package/lib/components/__tests__/Samples/use-example-key.test.js +28 -0
- package/lib/components/__tests__/common/ClearButton.test.d.ts +1 -0
- package/lib/components/__tests__/common/ClearButton.test.js +18 -0
- package/lib/components/__tests__/common/Dropdown.test.d.ts +1 -0
- package/lib/components/__tests__/common/Dropdown.test.js +52 -0
- package/lib/components/__tests__/mocks/examples.d.ts +4 -0
- package/lib/components/__tests__/mocks/examples.js +115 -0
- package/lib/components/common/__tests__/Dropdown.test.d.ts +1 -0
- package/lib/components/common/__tests__/Dropdown.test.js +129 -0
- package/lib/components/common/__tests__/LinkToField.test.d.ts +1 -0
- package/lib/components/common/__tests__/LinkToField.test.js +39 -0
- package/lib/jotai/__tests__/app.test.d.ts +1 -0
- package/lib/jotai/__tests__/app.test.js +53 -0
- package/lib/models/__tests__/Callback.test.d.ts +1 -0
- package/lib/models/__tests__/Callback.test.js +15 -0
- package/lib/models/__tests__/FieldModel.test.d.ts +1 -0
- package/lib/models/__tests__/FieldModel.test.js +117 -0
- package/lib/models/__tests__/MediaContent.test.d.ts +1 -0
- package/lib/models/__tests__/MediaContent.test.js +105 -0
- package/lib/models/__tests__/Operation.test.d.ts +1 -0
- package/lib/models/__tests__/Operation.test.js +459 -0
- package/lib/models/__tests__/Response.test.d.ts +1 -0
- package/lib/models/__tests__/Response.test.js +221 -0
- package/lib/models/__tests__/Schema.circular.test.d.ts +1 -0
- package/lib/models/__tests__/Schema.circular.test.js +694 -0
- package/lib/models/__tests__/Schema.test.d.ts +1 -0
- package/lib/models/__tests__/Schema.test.js +1395 -0
- package/lib/models/__tests__/example.test.d.ts +1 -0
- package/lib/models/__tests__/example.test.js +90 -0
- package/lib/models/__tests__/group.test.d.ts +1 -0
- package/lib/models/__tests__/group.test.js +52 -0
- package/lib/models/__tests__/helpers.d.ts +5 -0
- package/lib/models/__tests__/helpers.js +62 -0
- package/lib/models/__tests__/request.test.d.ts +1 -0
- package/lib/models/__tests__/request.test.js +119 -0
- package/lib/services/__tests__/OpenAPIParser.test.d.ts +1 -0
- package/lib/services/__tests__/OpenAPIParser.test.js +80 -0
- package/lib/services/__tests__/check.test.d.ts +1 -0
- package/lib/services/__tests__/check.test.js +22 -0
- package/lib/services/__tests__/utils.test.d.ts +1 -0
- package/lib/services/__tests__/utils.test.js +42 -0
- package/lib/services/code-samples/__tests__/apply-environments.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/apply-environments.test.js +64 -0
- package/lib/services/code-samples/__tests__/build-code-samples.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/build-code-samples.test.js +70 -0
- package/lib/services/code-samples/__tests__/convertSampleToString.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/convertSampleToString.test.js +116 -0
- package/lib/services/code-samples/__tests__/generator-data-value.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/generator-data-value.test.js +277 -0
- package/lib/services/code-samples/__tests__/generator-serialized-value.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/generator-serialized-value.test.js +258 -0
- package/lib/services/code-samples/__tests__/generator-value.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/generator-value.test.js +273 -0
- package/lib/services/code-samples/__tests__/generator.test.d.ts +249 -0
- package/lib/services/code-samples/__tests__/generator.test.js +1201 -0
- package/lib/services/code-samples/__tests__/get-example-value-by-mime-type.test.d.ts +1 -0
- package/lib/services/code-samples/__tests__/get-example-value-by-mime-type.test.js +31 -0
- package/lib/services/code-samples/httpsnippet/__tests__/device-authorization.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/__tests__/device-authorization.test.js +222 -0
- package/lib/services/code-samples/httpsnippet/helpers/__tests__/code-helpers.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/helpers/__tests__/code-helpers.test.js +129 -0
- package/lib/services/code-samples/httpsnippet/helpers/__tests__/string-utility.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/helpers/__tests__/string-utility.test.js +49 -0
- package/lib/services/code-samples/httpsnippet/targets/csharp/__tests__/httpclient.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/csharp/__tests__/httpclient.test.js +172 -0
- package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/__tests__/httpclient.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/csharpNewtonsoft/__tests__/httpclient.test.js +172 -0
- package/lib/services/code-samples/httpsnippet/targets/go/__tests__/native.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/go/__tests__/native.test.js +130 -0
- package/lib/services/code-samples/httpsnippet/targets/java/__tests__/httpclient.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/java/__tests__/httpclient.test.js +191 -0
- package/lib/services/code-samples/httpsnippet/targets/java8/__tests__/apachehttp.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/java8/__tests__/apachehttp.test.js +172 -0
- package/lib/services/code-samples/httpsnippet/targets/javascript/__tests__/fetch.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/javascript/__tests__/fetch.test.js +85 -0
- package/lib/services/code-samples/httpsnippet/targets/node/__tests__/fetch.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/node/__tests__/fetch.test.js +85 -0
- package/lib/services/code-samples/httpsnippet/targets/php/__tests__/curl.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/php/__tests__/curl.test.js +126 -0
- package/lib/services/code-samples/httpsnippet/targets/python/__tests__/requests.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/python/__tests__/requests.test.js +105 -0
- package/lib/services/code-samples/httpsnippet/targets/r/__tests__/httr.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/r/__tests__/httr.test.js +126 -0
- package/lib/services/code-samples/httpsnippet/targets/ruby/__tests__/native.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/ruby/__tests__/native.test.js +129 -0
- package/lib/services/code-samples/httpsnippet/targets/shell/__tests__/curl.test.d.ts +1 -0
- package/lib/services/code-samples/httpsnippet/targets/shell/__tests__/curl.test.js +129 -0
- package/lib/services/config-options/__tests__/helpers.test.d.ts +1 -0
- package/lib/services/config-options/__tests__/helpers.test.js +234 -0
- package/lib/services/history/__tests__/helpers.test.d.ts +1 -0
- package/lib/services/history/__tests__/helpers.test.js +19 -0
- package/lib/services/menu/__tests__/buildNestedTagsItems.test.d.ts +1 -0
- package/lib/services/menu/__tests__/buildNestedTagsItems.test.js +109 -0
- package/lib/services/menu/__tests__/builder.test.d.ts +1 -0
- package/lib/services/menu/__tests__/builder.test.js +307 -0
- package/lib/services/menu/__tests__/operation.test.d.ts +1 -0
- package/lib/services/menu/__tests__/operation.test.js +240 -0
- package/lib/services/menu/__tests__/tags.test.d.ts +1 -0
- package/lib/services/menu/__tests__/tags.test.js +71 -0
- package/lib/telemetry/RedocTelemetry.js +31 -1
- package/lib/telemetry/__tests__/RedocTelemetry.test.d.ts +1 -0
- package/lib/telemetry/__tests__/RedocTelemetry.test.js +107 -0
- package/lib/testProviders.d.ts +6 -0
- package/lib/testProviders.js +14 -0
- package/lib/utils/__tests__/areArraysEqual.test.d.ts +1 -0
- package/lib/utils/__tests__/areArraysEqual.test.js +33 -0
- package/lib/utils/__tests__/argValuesHelpers.d.ts +1 -0
- package/lib/utils/__tests__/argValuesHelpers.js +56 -0
- package/lib/utils/__tests__/calculateMaxLength.test.d.ts +1 -0
- package/lib/utils/__tests__/calculateMaxLength.test.js +119 -0
- package/lib/utils/__tests__/configure-helpers.test.d.ts +1 -0
- package/lib/utils/__tests__/configure-helpers.test.js +356 -0
- package/lib/utils/__tests__/convertSwagger2OpenAPI.test.d.ts +1 -0
- package/lib/utils/__tests__/convertSwagger2OpenAPI.test.js +392 -0
- package/lib/utils/__tests__/debounce.test.d.ts +1 -0
- package/lib/utils/__tests__/debounce.test.js +54 -0
- package/lib/utils/__tests__/debug.test.d.ts +1 -0
- package/lib/utils/__tests__/debug.test.js +23 -0
- package/lib/utils/__tests__/dom.test.d.ts +1 -0
- package/lib/utils/__tests__/dom.test.js +108 -0
- package/lib/utils/__tests__/getBreadcrumbs.test.d.ts +1 -0
- package/lib/utils/__tests__/getBreadcrumbs.test.js +98 -0
- package/lib/utils/__tests__/hasNestedFields.test.d.ts +1 -0
- package/lib/utils/__tests__/hasNestedFields.test.js +147 -0
- package/lib/utils/__tests__/helpers.test.d.ts +1 -0
- package/lib/utils/__tests__/helpers.test.js +174 -0
- package/lib/utils/__tests__/isMobile.test.d.ts +1 -0
- package/lib/utils/__tests__/isMobile.test.js +28 -0
- package/lib/utils/__tests__/loadAndBundleSpec.test.d.ts +1 -0
- package/lib/utils/__tests__/loadAndBundleSpec.test.js +22 -0
- package/lib/utils/__tests__/local-storage.test.d.ts +1 -0
- package/lib/utils/__tests__/local-storage.test.js +48 -0
- package/lib/utils/__tests__/object.test.d.ts +1 -0
- package/lib/utils/__tests__/object.test.js +45 -0
- package/lib/utils/__tests__/openapi.test.d.ts +1 -0
- package/lib/utils/__tests__/openapi.test.js +1378 -0
- package/lib/utils/__tests__/path.test.d.ts +1 -0
- package/lib/utils/__tests__/path.test.js +16 -0
- package/lib/utils/__tests__/queryString.test.d.ts +1 -0
- package/lib/utils/__tests__/queryString.test.js +60 -0
- package/lib/utils/__tests__/replaceVariables.test.d.ts +1 -0
- package/lib/utils/__tests__/replaceVariables.test.js +46 -0
- package/lib/utils/__tests__/simplifyAstStructure.test.d.ts +1 -0
- package/lib/utils/__tests__/simplifyAstStructure.test.js +26 -0
- package/lib/utils/__tests__/sort.test.d.ts +1 -0
- package/lib/utils/__tests__/sort.test.js +16 -0
- package/lib/utils/__tests__/string.test.d.ts +1 -0
- package/lib/utils/__tests__/string.test.js +16 -0
- package/lib/utils/__tests__/theme-helpers.test.d.ts +1 -0
- package/lib/utils/__tests__/theme-helpers.test.js +24 -0
- package/lib/utils/__tests__/url.test.d.ts +1 -0
- package/lib/utils/__tests__/url.test.js +134 -0
- package/package.json +4 -4
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { getOperation } from '../../../models/index.js';
|
|
2
|
+
import { getCodeSample } from '../generator.js';
|
|
3
|
+
import { OpenAPIParser } from '../../OpenAPIParser.js';
|
|
4
|
+
import { normalizeOptions } from '../../config-options/normalizeOptions.js';
|
|
5
|
+
describe('getDataRequest with value examples from OpenAPI 3.2', () => {
|
|
6
|
+
const testValueSpec = {
|
|
7
|
+
openapi: '3.2.0',
|
|
8
|
+
info: { version: '1.1.0', title: 'Redocly Museum API' },
|
|
9
|
+
servers: [{ url: 'https://api.fake-museum-example.com/v1.1' }],
|
|
10
|
+
paths: {
|
|
11
|
+
'/example-tests/value': {
|
|
12
|
+
post: {
|
|
13
|
+
summary: 'Test value field (OpenAPI 3.2)',
|
|
14
|
+
description: 'Demonstrates the use of value field which contains data in its natural form for validation.',
|
|
15
|
+
operationId: 'testValue',
|
|
16
|
+
requestBody: {
|
|
17
|
+
required: true,
|
|
18
|
+
content: {
|
|
19
|
+
'application/json': {
|
|
20
|
+
schema: {
|
|
21
|
+
type: 'object',
|
|
22
|
+
properties: {
|
|
23
|
+
name: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
},
|
|
26
|
+
value: {
|
|
27
|
+
type: 'string',
|
|
28
|
+
},
|
|
29
|
+
count: {
|
|
30
|
+
type: 'integer',
|
|
31
|
+
},
|
|
32
|
+
enabled: {
|
|
33
|
+
type: 'boolean',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
examples: {
|
|
38
|
+
json_data: {
|
|
39
|
+
summary: 'value with JSON object',
|
|
40
|
+
description: 'Uses value to show data in its natural form for validation',
|
|
41
|
+
value: {
|
|
42
|
+
name: 'Museum Visitor',
|
|
43
|
+
value: 'premium',
|
|
44
|
+
count: 5,
|
|
45
|
+
enabled: true,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
'application/xml': {
|
|
51
|
+
schema: {
|
|
52
|
+
type: 'object',
|
|
53
|
+
properties: {
|
|
54
|
+
name: {
|
|
55
|
+
type: 'string',
|
|
56
|
+
},
|
|
57
|
+
value: {
|
|
58
|
+
type: 'string',
|
|
59
|
+
},
|
|
60
|
+
count: {
|
|
61
|
+
type: 'integer',
|
|
62
|
+
},
|
|
63
|
+
enabled: {
|
|
64
|
+
type: 'boolean',
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
examples: {
|
|
69
|
+
xml_data: {
|
|
70
|
+
summary: 'value for XML content',
|
|
71
|
+
description: 'Data structure that will be serialized as XML',
|
|
72
|
+
value: `<item>
|
|
73
|
+
<name>Museum Visitor</name>
|
|
74
|
+
<value>premium</value>
|
|
75
|
+
<count>5</count>
|
|
76
|
+
<enabled>true</enabled>
|
|
77
|
+
</item>`,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
'application/x-www-form-urlencoded': {
|
|
82
|
+
schema: {
|
|
83
|
+
type: 'object',
|
|
84
|
+
properties: {
|
|
85
|
+
name: {
|
|
86
|
+
type: 'string',
|
|
87
|
+
},
|
|
88
|
+
value: {
|
|
89
|
+
type: 'string',
|
|
90
|
+
},
|
|
91
|
+
count: {
|
|
92
|
+
type: 'integer',
|
|
93
|
+
},
|
|
94
|
+
enabled: {
|
|
95
|
+
type: 'boolean',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
examples: {
|
|
100
|
+
url_encoded_data: {
|
|
101
|
+
summary: 'value for URL-encoded content',
|
|
102
|
+
description: 'Data structure that will be serialized as URL-encoded form',
|
|
103
|
+
value: {
|
|
104
|
+
name: 'Museum Visitor',
|
|
105
|
+
value: 'premium',
|
|
106
|
+
count: 5,
|
|
107
|
+
enabled: true,
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
'multipart/form-data': {
|
|
113
|
+
schema: {
|
|
114
|
+
type: 'object',
|
|
115
|
+
properties: {
|
|
116
|
+
name: {
|
|
117
|
+
type: 'string',
|
|
118
|
+
},
|
|
119
|
+
value: {
|
|
120
|
+
type: 'string',
|
|
121
|
+
},
|
|
122
|
+
count: {
|
|
123
|
+
type: 'integer',
|
|
124
|
+
},
|
|
125
|
+
enabled: {
|
|
126
|
+
type: 'boolean',
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
examples: {
|
|
131
|
+
multipart_data: {
|
|
132
|
+
summary: 'value for multipart/form-data',
|
|
133
|
+
description: 'Data structure that will be serialized as multipart form',
|
|
134
|
+
value: {
|
|
135
|
+
name: 'Museum Visitor',
|
|
136
|
+
value: 'premium',
|
|
137
|
+
count: 5,
|
|
138
|
+
file: 'museum-document.pdf',
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
'application/octet-stream': {
|
|
144
|
+
schema: {
|
|
145
|
+
type: 'string',
|
|
146
|
+
format: 'binary',
|
|
147
|
+
},
|
|
148
|
+
examples: {
|
|
149
|
+
octet_stream_data: {
|
|
150
|
+
summary: 'value for application/octet-stream',
|
|
151
|
+
description: 'Binary data represented as base64 string in data form',
|
|
152
|
+
value: 'SGVsbG8gV29ybGQ=',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
responses: {
|
|
159
|
+
'200': {
|
|
160
|
+
description: 'Success',
|
|
161
|
+
content: {
|
|
162
|
+
'application/json': {
|
|
163
|
+
schema: {
|
|
164
|
+
type: 'object',
|
|
165
|
+
properties: {
|
|
166
|
+
success: {
|
|
167
|
+
type: 'boolean',
|
|
168
|
+
},
|
|
169
|
+
message: {
|
|
170
|
+
type: 'string',
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
},
|
|
175
|
+
},
|
|
176
|
+
},
|
|
177
|
+
},
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
const options = normalizeOptions({});
|
|
183
|
+
let parser;
|
|
184
|
+
let operation;
|
|
185
|
+
const operationStore = {
|
|
186
|
+
activeServer: {
|
|
187
|
+
url: 'https://api.fake-museum-example.com/v1.1',
|
|
188
|
+
},
|
|
189
|
+
requestValues: {},
|
|
190
|
+
};
|
|
191
|
+
beforeEach(() => {
|
|
192
|
+
parser = new OpenAPIParser(testValueSpec, undefined, options);
|
|
193
|
+
const postOperation = testValueSpec.paths['/example-tests/value'].post;
|
|
194
|
+
operation = getOperation(parser, {
|
|
195
|
+
pointer: '#/paths/~1example-tests~1value/post',
|
|
196
|
+
pathName: '/example-tests/value',
|
|
197
|
+
httpVerb: 'POST',
|
|
198
|
+
pathParameters: [],
|
|
199
|
+
pathServers: [],
|
|
200
|
+
isWebhook: false,
|
|
201
|
+
isAdditionalOperation: false,
|
|
202
|
+
operationId: 'testValue',
|
|
203
|
+
defaultSampleName: 'defaultSampleName',
|
|
204
|
+
...postOperation,
|
|
205
|
+
responses: postOperation?.responses,
|
|
206
|
+
}, undefined, options, '');
|
|
207
|
+
});
|
|
208
|
+
const languages = [
|
|
209
|
+
{ name: 'curl', lang: 'curl' },
|
|
210
|
+
{ name: 'JavaScript', lang: 'JavaScript' },
|
|
211
|
+
{ name: 'Node.js', lang: 'Node.js' },
|
|
212
|
+
{ name: 'Python', lang: 'Python' },
|
|
213
|
+
{ name: 'Java8', lang: 'Java8+Apache' },
|
|
214
|
+
{ name: 'Java', lang: 'Java' },
|
|
215
|
+
{ name: 'C#', lang: 'C#' },
|
|
216
|
+
{ name: 'C#+Newtonsoft', lang: 'C#+Newtonsoft' },
|
|
217
|
+
{ name: 'PHP', lang: 'PHP' },
|
|
218
|
+
{ name: 'Go', lang: 'Go' },
|
|
219
|
+
{ name: 'Ruby', lang: 'Ruby' },
|
|
220
|
+
{ name: 'R', lang: 'R' },
|
|
221
|
+
];
|
|
222
|
+
const contentTypes = [
|
|
223
|
+
{
|
|
224
|
+
mimeType: 'application/json',
|
|
225
|
+
exampleName: 'json_data',
|
|
226
|
+
description: 'application/json',
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
mimeType: 'application/xml',
|
|
230
|
+
exampleName: 'xml_data',
|
|
231
|
+
description: 'application/xml',
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
mimeType: 'application/x-www-form-urlencoded',
|
|
235
|
+
exampleName: 'url_encoded_data',
|
|
236
|
+
description: 'application/x-www-form-urlencoded',
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
mimeType: 'multipart/form-data',
|
|
240
|
+
exampleName: 'multipart_data',
|
|
241
|
+
description: 'multipart/form-data',
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
mimeType: 'application/octet-stream',
|
|
245
|
+
exampleName: 'octet_stream_data',
|
|
246
|
+
description: 'application/octet-stream',
|
|
247
|
+
},
|
|
248
|
+
];
|
|
249
|
+
contentTypes.forEach(({ mimeType, exampleName, description }) => {
|
|
250
|
+
describe(`${description} with Value`, () => {
|
|
251
|
+
languages.forEach(({ name, lang }) => {
|
|
252
|
+
it(`should generate code sample for ${name}`, () => {
|
|
253
|
+
const sample = getCodeSample({
|
|
254
|
+
lang: lang,
|
|
255
|
+
operation,
|
|
256
|
+
exampleName,
|
|
257
|
+
options: {
|
|
258
|
+
store: operationStore,
|
|
259
|
+
activeMimeName: mimeType,
|
|
260
|
+
spec: testValueSpec,
|
|
261
|
+
},
|
|
262
|
+
environment: {
|
|
263
|
+
server: 'https://api.fake-museum-example.com/v1.1',
|
|
264
|
+
},
|
|
265
|
+
translate: (_key, defaultValue) => defaultValue,
|
|
266
|
+
});
|
|
267
|
+
expect(sample).toMatchSnapshot();
|
|
268
|
+
});
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
});
|
|
273
|
+
//# sourceMappingURL=generator-value.test.js.map
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
export declare const testGetOperation: {
|
|
2
|
+
summary: string;
|
|
3
|
+
responses: {
|
|
4
|
+
'200': {};
|
|
5
|
+
};
|
|
6
|
+
parameters: {
|
|
7
|
+
name: string;
|
|
8
|
+
in: 'path';
|
|
9
|
+
schema: {
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
12
|
+
}[];
|
|
13
|
+
requestBody: {
|
|
14
|
+
content: {
|
|
15
|
+
'application/json': {
|
|
16
|
+
schema: {
|
|
17
|
+
type: string;
|
|
18
|
+
properties: {
|
|
19
|
+
a: {
|
|
20
|
+
type: string;
|
|
21
|
+
};
|
|
22
|
+
b: {
|
|
23
|
+
type: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
'application/x-www-form-urlencoded': {
|
|
29
|
+
schema: {
|
|
30
|
+
type: string;
|
|
31
|
+
properties: {
|
|
32
|
+
a: {
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
b: {
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
'application/xml': {
|
|
42
|
+
schema: {
|
|
43
|
+
type: string;
|
|
44
|
+
properties: {
|
|
45
|
+
a: {
|
|
46
|
+
type: string;
|
|
47
|
+
example: string;
|
|
48
|
+
};
|
|
49
|
+
b: {
|
|
50
|
+
type: string;
|
|
51
|
+
};
|
|
52
|
+
d: {
|
|
53
|
+
type: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
'multipart/form-data': {
|
|
59
|
+
schema: {
|
|
60
|
+
type: string;
|
|
61
|
+
properties: {
|
|
62
|
+
a: {
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
b: {
|
|
66
|
+
type: string;
|
|
67
|
+
};
|
|
68
|
+
d: {
|
|
69
|
+
type: string;
|
|
70
|
+
};
|
|
71
|
+
g: {
|
|
72
|
+
type: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
export declare const testPostOperation: {
|
|
81
|
+
summary: string;
|
|
82
|
+
responses: {
|
|
83
|
+
'200': {};
|
|
84
|
+
};
|
|
85
|
+
parameters: {
|
|
86
|
+
name: string;
|
|
87
|
+
in: 'cookie';
|
|
88
|
+
schema: {
|
|
89
|
+
type: string;
|
|
90
|
+
};
|
|
91
|
+
}[];
|
|
92
|
+
requestBody: {
|
|
93
|
+
content: {
|
|
94
|
+
'application/json': {
|
|
95
|
+
schema: {
|
|
96
|
+
type: string;
|
|
97
|
+
properties: {
|
|
98
|
+
a: {
|
|
99
|
+
type: string;
|
|
100
|
+
};
|
|
101
|
+
b: {
|
|
102
|
+
type: string;
|
|
103
|
+
};
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
export declare const testDefinition: {
|
|
111
|
+
openapi: string;
|
|
112
|
+
info: {
|
|
113
|
+
version: string;
|
|
114
|
+
title: string;
|
|
115
|
+
};
|
|
116
|
+
security: ({
|
|
117
|
+
testApiKey: never[];
|
|
118
|
+
testBasicAuth?: undefined;
|
|
119
|
+
} | {
|
|
120
|
+
testBasicAuth: never[];
|
|
121
|
+
testApiKey: never[];
|
|
122
|
+
})[];
|
|
123
|
+
paths: {
|
|
124
|
+
'/test/{id}': {
|
|
125
|
+
get: {
|
|
126
|
+
summary: string;
|
|
127
|
+
responses: {
|
|
128
|
+
'200': {};
|
|
129
|
+
};
|
|
130
|
+
parameters: {
|
|
131
|
+
name: string;
|
|
132
|
+
in: 'path';
|
|
133
|
+
schema: {
|
|
134
|
+
type: string;
|
|
135
|
+
};
|
|
136
|
+
}[];
|
|
137
|
+
requestBody: {
|
|
138
|
+
content: {
|
|
139
|
+
'application/json': {
|
|
140
|
+
schema: {
|
|
141
|
+
type: string;
|
|
142
|
+
properties: {
|
|
143
|
+
a: {
|
|
144
|
+
type: string;
|
|
145
|
+
};
|
|
146
|
+
b: {
|
|
147
|
+
type: string;
|
|
148
|
+
};
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
'application/x-www-form-urlencoded': {
|
|
153
|
+
schema: {
|
|
154
|
+
type: string;
|
|
155
|
+
properties: {
|
|
156
|
+
a: {
|
|
157
|
+
type: string;
|
|
158
|
+
};
|
|
159
|
+
b: {
|
|
160
|
+
type: string;
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
'application/xml': {
|
|
166
|
+
schema: {
|
|
167
|
+
type: string;
|
|
168
|
+
properties: {
|
|
169
|
+
a: {
|
|
170
|
+
type: string;
|
|
171
|
+
example: string;
|
|
172
|
+
};
|
|
173
|
+
b: {
|
|
174
|
+
type: string;
|
|
175
|
+
};
|
|
176
|
+
d: {
|
|
177
|
+
type: string;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
};
|
|
182
|
+
'multipart/form-data': {
|
|
183
|
+
schema: {
|
|
184
|
+
type: string;
|
|
185
|
+
properties: {
|
|
186
|
+
a: {
|
|
187
|
+
type: string;
|
|
188
|
+
};
|
|
189
|
+
b: {
|
|
190
|
+
type: string;
|
|
191
|
+
};
|
|
192
|
+
d: {
|
|
193
|
+
type: string;
|
|
194
|
+
};
|
|
195
|
+
g: {
|
|
196
|
+
type: string;
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
post: {
|
|
205
|
+
summary: string;
|
|
206
|
+
responses: {
|
|
207
|
+
'200': {};
|
|
208
|
+
};
|
|
209
|
+
parameters: {
|
|
210
|
+
name: string;
|
|
211
|
+
in: 'cookie';
|
|
212
|
+
schema: {
|
|
213
|
+
type: string;
|
|
214
|
+
};
|
|
215
|
+
}[];
|
|
216
|
+
requestBody: {
|
|
217
|
+
content: {
|
|
218
|
+
'application/json': {
|
|
219
|
+
schema: {
|
|
220
|
+
type: string;
|
|
221
|
+
properties: {
|
|
222
|
+
a: {
|
|
223
|
+
type: string;
|
|
224
|
+
};
|
|
225
|
+
b: {
|
|
226
|
+
type: string;
|
|
227
|
+
};
|
|
228
|
+
};
|
|
229
|
+
};
|
|
230
|
+
};
|
|
231
|
+
};
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
};
|
|
235
|
+
};
|
|
236
|
+
components: {
|
|
237
|
+
securitySchemes: {
|
|
238
|
+
testApiKey: {
|
|
239
|
+
type: string;
|
|
240
|
+
in: string;
|
|
241
|
+
name: string;
|
|
242
|
+
};
|
|
243
|
+
testBasicAuth: {
|
|
244
|
+
type: string;
|
|
245
|
+
scheme: string;
|
|
246
|
+
};
|
|
247
|
+
};
|
|
248
|
+
};
|
|
249
|
+
};
|