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