docusaurus-theme-openapi-docs 0.0.0-1000
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/LICENSE +21 -0
- package/babel.config.js +35 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +81 -0
- package/lib/markdown/createDescription.d.ts +1 -0
- package/lib/markdown/createDescription.js +15 -0
- package/lib/markdown/schema.d.ts +3 -0
- package/lib/markdown/schema.js +149 -0
- package/lib/markdown/utils.d.ts +10 -0
- package/lib/markdown/utils.js +49 -0
- package/lib/markdown/utils.test.d.ts +1 -0
- package/lib/markdown/utils.test.js +43 -0
- package/lib/theme/ApiExplorer/Accept/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Accept/index.js +38 -0
- package/lib/theme/ApiExplorer/Accept/slice.d.ts +11 -0
- package/lib/theme/ApiExplorer/Accept/slice.js +22 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.d.ts +4 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Container/index.js +35 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/Element.js +41 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/String.js +153 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.js +147 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.js +58 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.d.ts +14 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.js +248 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/Line/index.js +59 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.js +51 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ApiCodeBlock/index.js +110 -0
- package/lib/theme/ApiExplorer/Authorization/auth-types.d.ts +3 -0
- package/lib/theme/ApiExplorer/Authorization/auth-types.js +28 -0
- package/lib/theme/ApiExplorer/Authorization/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Authorization/index.js +160 -0
- package/lib/theme/ApiExplorer/Authorization/slice.d.ts +40 -0
- package/lib/theme/ApiExplorer/Authorization/slice.js +102 -0
- package/lib/theme/ApiExplorer/Body/index.d.ts +10 -0
- package/lib/theme/ApiExplorer/Body/index.js +381 -0
- package/lib/theme/ApiExplorer/Body/json2xml.js +43 -0
- package/lib/theme/ApiExplorer/Body/slice.d.ts +82 -0
- package/lib/theme/ApiExplorer/Body/slice.js +97 -0
- package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.d.ts +21 -0
- package/lib/theme/ApiExplorer/CodeSnippets/code-snippets-types.js +8 -0
- package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +10 -0
- package/lib/theme/ApiExplorer/CodeSnippets/index.js +389 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.d.ts +5 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.js +95 -0
- package/lib/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
- package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +501 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +15 -0
- package/lib/theme/ApiExplorer/CodeTabs/index.js +271 -0
- package/lib/theme/ApiExplorer/ContentType/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/ContentType/index.js +40 -0
- package/lib/theme/ApiExplorer/ContentType/slice.d.ts +11 -0
- package/lib/theme/ApiExplorer/ContentType/slice.js +22 -0
- package/lib/theme/ApiExplorer/Export/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Export/index.js +57 -0
- package/lib/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
- package/lib/theme/ApiExplorer/FloatingButton/index.d.ts +8 -0
- package/lib/theme/ApiExplorer/FloatingButton/index.js +28 -0
- package/lib/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
- package/lib/theme/ApiExplorer/FormFileUpload/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/FormFileUpload/index.js +173 -0
- package/lib/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
- package/lib/theme/ApiExplorer/FormItem/index.d.ts +10 -0
- package/lib/theme/ApiExplorer/FormItem/index.js +44 -0
- package/lib/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
- package/lib/theme/ApiExplorer/FormMultiSelect/index.d.ts +9 -0
- package/lib/theme/ApiExplorer/FormMultiSelect/index.js +51 -0
- package/lib/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
- package/lib/theme/ApiExplorer/FormSelect/index.d.ts +8 -0
- package/lib/theme/ApiExplorer/FormSelect/index.js +35 -0
- package/lib/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
- package/lib/theme/ApiExplorer/FormTextInput/index.d.ts +9 -0
- package/lib/theme/ApiExplorer/FormTextInput/index.js +73 -0
- package/lib/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
- package/lib/theme/ApiExplorer/LiveEditor/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/LiveEditor/index.js +168 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/index.d.ts +8 -0
- package/lib/theme/ApiExplorer/MethodEndpoint/index.js +86 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +220 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +63 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +89 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +63 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.d.ts +6 -0
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.js +38 -0
- package/lib/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
- package/lib/theme/ApiExplorer/ParamOptions/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/ParamOptions/index.js +223 -0
- package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +17 -0
- package/lib/theme/ApiExplorer/ParamOptions/slice.js +25 -0
- package/lib/theme/ApiExplorer/Request/_Request.scss +129 -0
- package/lib/theme/ApiExplorer/Request/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/Request/index.js +396 -0
- package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +4 -0
- package/lib/theme/ApiExplorer/Request/makeRequest.js +222 -0
- package/lib/theme/ApiExplorer/Response/_Response.scss +121 -0
- package/lib/theme/ApiExplorer/Response/index.d.ts +6 -0
- package/lib/theme/ApiExplorer/Response/index.js +193 -0
- package/lib/theme/ApiExplorer/Response/slice.d.ts +17 -0
- package/lib/theme/ApiExplorer/Response/slice.js +51 -0
- package/lib/theme/ApiExplorer/SecuritySchemes/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/SecuritySchemes/index.js +380 -0
- package/lib/theme/ApiExplorer/Server/_Server.scss +26 -0
- package/lib/theme/ApiExplorer/Server/index.d.ts +3 -0
- package/lib/theme/ApiExplorer/Server/index.js +199 -0
- package/lib/theme/ApiExplorer/Server/slice.d.ts +13 -0
- package/lib/theme/ApiExplorer/Server/slice.js +33 -0
- package/lib/theme/ApiExplorer/buildPostmanRequest.d.ts +20 -0
- package/lib/theme/ApiExplorer/buildPostmanRequest.js +465 -0
- package/lib/theme/ApiExplorer/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/index.js +41 -0
- package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +3 -0
- package/lib/theme/ApiExplorer/persistanceMiddleware.js +54 -0
- package/lib/theme/ApiExplorer/storage-utils.d.ts +4 -0
- package/lib/theme/ApiExplorer/storage-utils.js +41 -0
- package/lib/theme/ApiItem/Layout/index.d.ts +3 -0
- package/lib/theme/ApiItem/Layout/index.js +121 -0
- package/lib/theme/ApiItem/Layout/styles.module.css +17 -0
- package/lib/theme/ApiItem/hooks.d.ts +12 -0
- package/lib/theme/ApiItem/hooks.js +13 -0
- package/lib/theme/ApiItem/index.d.ts +2 -0
- package/lib/theme/ApiItem/index.js +238 -0
- package/lib/theme/ApiItem/store.d.ts +46 -0
- package/lib/theme/ApiItem/store.js +53 -0
- package/lib/theme/ApiLogo/index.d.ts +2 -0
- package/lib/theme/ApiLogo/index.js +51 -0
- package/lib/theme/ApiTabs/_ApiTabs.scss +142 -0
- package/lib/theme/ApiTabs/index.d.ts +7 -0
- package/lib/theme/ApiTabs/index.js +270 -0
- package/lib/theme/ArrayBrackets/index.d.ts +3 -0
- package/lib/theme/ArrayBrackets/index.js +50 -0
- package/lib/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
- package/lib/theme/DiscriminatorTabs/index.d.ts +3 -0
- package/lib/theme/DiscriminatorTabs/index.js +258 -0
- package/lib/theme/Markdown/Details/_Details.scss +122 -0
- package/lib/theme/Markdown/index.js +179 -0
- package/lib/theme/MimeTabs/_MimeTabs.scss +70 -0
- package/lib/theme/MimeTabs/index.d.ts +6 -0
- package/lib/theme/MimeTabs/index.js +286 -0
- package/lib/theme/OperationTabs/_OperationTabs.scss +72 -0
- package/lib/theme/OperationTabs/index.d.ts +3 -0
- package/lib/theme/OperationTabs/index.js +248 -0
- package/lib/theme/ParamsDetails/index.d.ts +6 -0
- package/lib/theme/ParamsDetails/index.js +85 -0
- package/lib/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/lib/theme/ParamsItem/index.d.ts +25 -0
- package/lib/theme/ParamsItem/index.js +218 -0
- package/lib/theme/RequestSchema/index.d.ts +15 -0
- package/lib/theme/RequestSchema/index.js +194 -0
- package/lib/theme/ResponseExamples/index.d.ts +18 -0
- package/lib/theme/ResponseExamples/index.js +193 -0
- package/lib/theme/ResponseHeaders/index.d.ts +13 -0
- package/lib/theme/ResponseHeaders/index.js +39 -0
- package/lib/theme/ResponseSamples/_ResponseSamples.scss +3 -0
- package/lib/theme/ResponseSamples/index.d.ts +8 -0
- package/lib/theme/ResponseSamples/index.js +27 -0
- package/lib/theme/ResponseSchema/index.d.ts +15 -0
- package/lib/theme/ResponseSchema/index.js +159 -0
- package/lib/theme/Schema/index.d.ts +8 -0
- package/lib/theme/Schema/index.js +885 -0
- package/lib/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/lib/theme/SchemaItem/index.d.ts +12 -0
- package/lib/theme/SchemaItem/index.js +213 -0
- package/lib/theme/SchemaTabs/_SchemaTabs.scss +61 -0
- package/lib/theme/SchemaTabs/index.d.ts +3 -0
- package/lib/theme/SchemaTabs/index.js +255 -0
- package/lib/theme/SkeletonLoader/index.d.ts +6 -0
- package/lib/theme/SkeletonLoader/index.js +20 -0
- package/lib/theme/StatusCodes/index.d.ts +9 -0
- package/lib/theme/StatusCodes/index.js +81 -0
- package/lib/theme/styles.scss +212 -0
- package/lib/types.d.ts +157 -0
- package/lib/types.js +8 -0
- package/package.json +83 -0
- package/src/index.ts +85 -0
- package/src/markdown/createDescription.ts +13 -0
- package/src/markdown/schema.ts +181 -0
- package/src/markdown/utils.test.ts +49 -0
- package/src/markdown/utils.ts +59 -0
- package/src/plugin-content-docs.d.ts +20 -0
- package/src/postman-code-generators.d.ts +9 -0
- package/src/react-magic-dropzone.d.ts +9 -0
- package/src/theme/ApiExplorer/Accept/index.tsx +36 -0
- package/src/theme/ApiExplorer/Accept/slice.ts +29 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/_Container.scss +7 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Container/index.tsx +32 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/Element.tsx +34 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/String.tsx +134 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Content/_Content.scss +91 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/_CopyButton.scss +44 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/CopyButton/index.tsx +79 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/_ExitButton.scss +16 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExitButton/index.tsx +55 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/_ExpandButton.scss +62 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/ExpandButton/index.tsx +166 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/_Line.scss +34 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/Line/index.tsx +48 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/_WordWrapButton.scss +10 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/WordWrapButton/index.tsx +54 -0
- package/src/theme/ApiExplorer/ApiCodeBlock/index.tsx +45 -0
- package/src/theme/ApiExplorer/Authorization/auth-types.ts +30 -0
- package/src/theme/ApiExplorer/Authorization/index.tsx +158 -0
- package/src/theme/ApiExplorer/Authorization/slice.ts +146 -0
- package/src/theme/ApiExplorer/Body/index.tsx +376 -0
- package/src/theme/ApiExplorer/Body/json2xml.js +43 -0
- package/src/theme/ApiExplorer/Body/slice.ts +133 -0
- package/src/theme/ApiExplorer/CodeSnippets/code-snippets-types.ts +57 -0
- package/src/theme/ApiExplorer/CodeSnippets/index.tsx +338 -0
- package/src/theme/ApiExplorer/CodeSnippets/languages.json +1290 -0
- package/src/theme/ApiExplorer/CodeSnippets/languages.ts +96 -0
- package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +501 -0
- package/src/theme/ApiExplorer/CodeTabs/index.tsx +248 -0
- package/src/theme/ApiExplorer/ContentType/index.tsx +38 -0
- package/src/theme/ApiExplorer/ContentType/slice.ts +29 -0
- package/src/theme/ApiExplorer/Export/index.tsx +47 -0
- package/src/theme/ApiExplorer/FloatingButton/_FloatingButton.scss +27 -0
- package/src/theme/ApiExplorer/FloatingButton/index.tsx +29 -0
- package/src/theme/ApiExplorer/FormFileUpload/_FormFileUpload.scss +74 -0
- package/src/theme/ApiExplorer/FormFileUpload/index.tsx +119 -0
- package/src/theme/ApiExplorer/FormItem/_FormItem.scss +21 -0
- package/src/theme/ApiExplorer/FormItem/index.tsx +33 -0
- package/src/theme/ApiExplorer/FormMultiSelect/_FormMultiSelect.scss +30 -0
- package/src/theme/ApiExplorer/FormMultiSelect/index.tsx +57 -0
- package/src/theme/ApiExplorer/FormSelect/_FormSelect.scss +43 -0
- package/src/theme/ApiExplorer/FormSelect/index.tsx +38 -0
- package/src/theme/ApiExplorer/FormTextInput/_FormTextInput.scss +34 -0
- package/src/theme/ApiExplorer/FormTextInput/index.tsx +80 -0
- package/src/theme/ApiExplorer/LiveEditor/_LiveEditor.scss +15 -0
- package/src/theme/ApiExplorer/LiveEditor/index.tsx +114 -0
- package/src/theme/ApiExplorer/MethodEndpoint/_MethodEndpoint.scss +22 -0
- package/src/theme/ApiExplorer/MethodEndpoint/index.tsx +91 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +175 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +64 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +86 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +65 -0
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamTextFormItem.tsx +38 -0
- package/src/theme/ApiExplorer/ParamOptions/_ParamOptions.scss +123 -0
- package/src/theme/ApiExplorer/ParamOptions/index.tsx +146 -0
- package/src/theme/ApiExplorer/ParamOptions/slice.ts +37 -0
- package/src/theme/ApiExplorer/Request/_Request.scss +129 -0
- package/src/theme/ApiExplorer/Request/index.tsx +309 -0
- package/src/theme/ApiExplorer/Request/makeRequest.ts +254 -0
- package/src/theme/ApiExplorer/Response/_Response.scss +121 -0
- package/src/theme/ApiExplorer/Response/index.tsx +157 -0
- package/src/theme/ApiExplorer/Response/slice.ts +52 -0
- package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +287 -0
- package/src/theme/ApiExplorer/Server/_Server.scss +26 -0
- package/src/theme/ApiExplorer/Server/index.tsx +130 -0
- package/src/theme/ApiExplorer/Server/slice.ts +39 -0
- package/src/theme/ApiExplorer/buildPostmanRequest.ts +526 -0
- package/src/theme/ApiExplorer/index.tsx +41 -0
- package/src/theme/ApiExplorer/persistanceMiddleware.ts +71 -0
- package/src/theme/ApiExplorer/postman-collection.d.ts +10 -0
- package/src/theme/ApiExplorer/react-modal.d.ts +8 -0
- package/src/theme/ApiExplorer/storage-utils.ts +39 -0
- package/src/theme/ApiItem/Layout/index.tsx +85 -0
- package/src/theme/ApiItem/Layout/styles.module.css +17 -0
- package/src/theme/ApiItem/hooks.ts +13 -0
- package/src/theme/ApiItem/index.tsx +222 -0
- package/src/theme/ApiItem/store.ts +51 -0
- package/src/theme/ApiLogo/index.tsx +52 -0
- package/src/theme/ApiTabs/_ApiTabs.scss +142 -0
- package/src/theme/ApiTabs/index.tsx +238 -0
- package/src/theme/ArrayBrackets/index.tsx +37 -0
- package/src/theme/DiscriminatorTabs/_DiscriminatorTabs.scss +98 -0
- package/src/theme/DiscriminatorTabs/index.tsx +229 -0
- package/src/theme/Markdown/Details/_Details.scss +122 -0
- package/src/theme/Markdown/index.js +179 -0
- package/src/theme/MimeTabs/_MimeTabs.scss +70 -0
- package/src/theme/MimeTabs/index.tsx +257 -0
- package/src/theme/OperationTabs/_OperationTabs.scss +72 -0
- package/src/theme/OperationTabs/index.tsx +220 -0
- package/src/theme/ParamsDetails/index.tsx +81 -0
- package/src/theme/ParamsItem/_ParamsItem.scss +54 -0
- package/src/theme/ParamsItem/index.tsx +205 -0
- package/src/theme/RequestSchema/index.tsx +157 -0
- package/src/theme/ResponseExamples/index.tsx +192 -0
- package/src/theme/ResponseHeaders/index.tsx +49 -0
- package/src/theme/ResponseSamples/_ResponseSamples.scss +3 -0
- package/src/theme/ResponseSamples/index.tsx +31 -0
- package/src/theme/ResponseSchema/index.tsx +144 -0
- package/src/theme/Schema/index.tsx +939 -0
- package/src/theme/SchemaItem/_SchemaItem.scss +89 -0
- package/src/theme/SchemaItem/index.tsx +198 -0
- package/src/theme/SchemaTabs/_SchemaTabs.scss +61 -0
- package/src/theme/SchemaTabs/index.tsx +224 -0
- package/src/theme/SkeletonLoader/index.tsx +18 -0
- package/src/theme/StatusCodes/index.tsx +72 -0
- package/src/theme/styles.scss +212 -0
- package/src/theme-classic.d.ts +80 -0
- package/src/theme-openapi.d.ts +288 -0
- package/src/theme-translations.d.ts +9 -0
- package/src/types.ts +182 -0
- package/tsconfig.json +16 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* Copyright (c) Palo Alto Networks
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
import BrowserOnly from "@docusaurus/BrowserOnly";
|
|
11
|
+
import Details from "@theme/Details";
|
|
12
|
+
import Markdown from "@theme/Markdown";
|
|
13
|
+
import MimeTabs from "@theme/MimeTabs"; // Assume these components exist
|
|
14
|
+
import SchemaNode from "@theme/Schema";
|
|
15
|
+
import SkeletonLoader from "@theme/SkeletonLoader";
|
|
16
|
+
import TabItem from "@theme/TabItem";
|
|
17
|
+
import { MediaTypeObject } from "docusaurus-plugin-openapi-docs/lib/openapi/types";
|
|
18
|
+
|
|
19
|
+
interface Props {
|
|
20
|
+
style?: React.CSSProperties;
|
|
21
|
+
title: string;
|
|
22
|
+
body: {
|
|
23
|
+
content?: {
|
|
24
|
+
[key: string]: MediaTypeObject;
|
|
25
|
+
};
|
|
26
|
+
description?: string;
|
|
27
|
+
required?: string[] | boolean;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const RequestSchemaComponent: React.FC<Props> = ({ title, body, style }) => {
|
|
32
|
+
if (
|
|
33
|
+
body === undefined ||
|
|
34
|
+
body.content === undefined ||
|
|
35
|
+
Object.keys(body).length === 0 ||
|
|
36
|
+
Object.keys(body.content).length === 0
|
|
37
|
+
) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const mimeTypes = Object.keys(body.content);
|
|
42
|
+
|
|
43
|
+
if (mimeTypes.length > 1) {
|
|
44
|
+
return (
|
|
45
|
+
<MimeTabs className="openapi-tabs__mime" schemaType="request">
|
|
46
|
+
{mimeTypes.map((mimeType) => {
|
|
47
|
+
const firstBody = body.content![mimeType].schema;
|
|
48
|
+
if (
|
|
49
|
+
firstBody === undefined ||
|
|
50
|
+
(firstBody.properties &&
|
|
51
|
+
Object.keys(firstBody.properties).length === 0)
|
|
52
|
+
) {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
return (
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
<TabItem key={mimeType} label={mimeType} value={mimeType}>
|
|
58
|
+
<Details
|
|
59
|
+
className="openapi-markdown__details mime"
|
|
60
|
+
data-collapsed={false}
|
|
61
|
+
open={true}
|
|
62
|
+
style={style}
|
|
63
|
+
summary={
|
|
64
|
+
<>
|
|
65
|
+
<summary>
|
|
66
|
+
<h3 className="openapi-markdown__details-summary-header-body">
|
|
67
|
+
{title}
|
|
68
|
+
{body.required === true && (
|
|
69
|
+
<span className="openapi-schema__required">
|
|
70
|
+
required
|
|
71
|
+
</span>
|
|
72
|
+
)}
|
|
73
|
+
</h3>
|
|
74
|
+
</summary>
|
|
75
|
+
</>
|
|
76
|
+
}
|
|
77
|
+
>
|
|
78
|
+
<div style={{ textAlign: "left", marginLeft: "1rem" }}>
|
|
79
|
+
{body.description && (
|
|
80
|
+
<div style={{ marginTop: "1rem", marginBottom: "1rem" }}>
|
|
81
|
+
<Markdown>{body.description}</Markdown>
|
|
82
|
+
</div>
|
|
83
|
+
)}
|
|
84
|
+
</div>
|
|
85
|
+
<ul style={{ marginLeft: "1rem" }}>
|
|
86
|
+
<SchemaNode schema={firstBody} schemaType="request" />
|
|
87
|
+
</ul>
|
|
88
|
+
</Details>
|
|
89
|
+
</TabItem>
|
|
90
|
+
);
|
|
91
|
+
})}
|
|
92
|
+
</MimeTabs>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
const randomFirstKey = mimeTypes[0];
|
|
97
|
+
const firstBody =
|
|
98
|
+
body.content[randomFirstKey].schema ?? body.content![randomFirstKey];
|
|
99
|
+
|
|
100
|
+
if (firstBody === undefined) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<MimeTabs className="openapi-tabs__mime" schemaType="request">
|
|
106
|
+
{/* @ts-ignore */}
|
|
107
|
+
<TabItem label={randomFirstKey} value={`${randomFirstKey}-schema`}>
|
|
108
|
+
<Details
|
|
109
|
+
className="openapi-markdown__details mime"
|
|
110
|
+
data-collapsed={false}
|
|
111
|
+
open={true}
|
|
112
|
+
style={style}
|
|
113
|
+
summary={
|
|
114
|
+
<>
|
|
115
|
+
<summary>
|
|
116
|
+
<h3 className="openapi-markdown__details-summary-header-body">
|
|
117
|
+
{title}
|
|
118
|
+
{firstBody.type === "array" && (
|
|
119
|
+
<span style={{ opacity: "0.6" }}> array</span>
|
|
120
|
+
)}
|
|
121
|
+
{body.required && (
|
|
122
|
+
<strong className="openapi-schema__required">
|
|
123
|
+
required
|
|
124
|
+
</strong>
|
|
125
|
+
)}
|
|
126
|
+
</h3>
|
|
127
|
+
</summary>
|
|
128
|
+
</>
|
|
129
|
+
}
|
|
130
|
+
>
|
|
131
|
+
<div style={{ textAlign: "left", marginLeft: "1rem" }}>
|
|
132
|
+
{body.description && (
|
|
133
|
+
<div style={{ marginTop: "1rem", marginBottom: "1rem" }}>
|
|
134
|
+
<Markdown>{body.description}</Markdown>
|
|
135
|
+
</div>
|
|
136
|
+
)}
|
|
137
|
+
</div>
|
|
138
|
+
<ul style={{ marginLeft: "1rem" }}>
|
|
139
|
+
<SchemaNode schema={firstBody} schemaType="request" />
|
|
140
|
+
</ul>
|
|
141
|
+
</Details>
|
|
142
|
+
</TabItem>
|
|
143
|
+
</MimeTabs>
|
|
144
|
+
);
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const RequestSchema: React.FC<Props> = (props) => {
|
|
148
|
+
return (
|
|
149
|
+
<BrowserOnly fallback={<SkeletonLoader size="sm" />}>
|
|
150
|
+
{() => {
|
|
151
|
+
return <RequestSchemaComponent {...props} />;
|
|
152
|
+
}}
|
|
153
|
+
</BrowserOnly>
|
|
154
|
+
);
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
export default RequestSchema;
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* Copyright (c) Palo Alto Networks
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
import Markdown from "@theme/Markdown";
|
|
11
|
+
import ResponseSamples from "@theme/ResponseSamples";
|
|
12
|
+
import TabItem from "@theme/TabItem";
|
|
13
|
+
import { sampleResponseFromSchema } from "docusaurus-plugin-openapi-docs/lib/openapi/createResponseExample";
|
|
14
|
+
import format from "xml-formatter";
|
|
15
|
+
|
|
16
|
+
export function json2xml(o: Record<string, any>, tab: string): string {
|
|
17
|
+
const toXml = (v: any, name: string, ind: string): string => {
|
|
18
|
+
let xml = "";
|
|
19
|
+
if (v instanceof Array) {
|
|
20
|
+
for (let i = 0, n = v.length; i < n; i++) {
|
|
21
|
+
xml += ind + toXml(v[i], name, ind + "\t") + "\n";
|
|
22
|
+
}
|
|
23
|
+
} else if (typeof v === "object") {
|
|
24
|
+
let hasChild = false;
|
|
25
|
+
xml += ind + "<" + name;
|
|
26
|
+
for (const m in v) {
|
|
27
|
+
if (m.charAt(0) === "@") {
|
|
28
|
+
xml += " " + m.substr(1) + '="' + v[m].toString() + '"';
|
|
29
|
+
} else {
|
|
30
|
+
hasChild = true;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
xml += hasChild ? ">" : "/>";
|
|
34
|
+
if (hasChild) {
|
|
35
|
+
for (const m2 in v) {
|
|
36
|
+
if (m2 === "#text") xml += v[m2];
|
|
37
|
+
else if (m2 === "#cdata") xml += "<![CDATA[" + v[m2] + "]]>";
|
|
38
|
+
else if (m2.charAt(0) !== "@") xml += toXml(v[m2], m2, ind + "\t");
|
|
39
|
+
}
|
|
40
|
+
xml +=
|
|
41
|
+
(xml.charAt(xml.length - 1) === "\n" ? ind : "") + "</" + name + ">";
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
xml += ind + "<" + name + ">" + v.toString() + "</" + name + ">";
|
|
45
|
+
}
|
|
46
|
+
return xml;
|
|
47
|
+
};
|
|
48
|
+
let xml = "";
|
|
49
|
+
for (const m3 in o) xml += toXml(o[m3], m3, "");
|
|
50
|
+
return tab ? xml.replace(/\t/g, tab) : xml.replace(/\t|\n/g, "");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface ResponseExamplesProps {
|
|
54
|
+
responseExamples: any;
|
|
55
|
+
mimeType: string;
|
|
56
|
+
}
|
|
57
|
+
export const ResponseExamples: React.FC<ResponseExamplesProps> = ({
|
|
58
|
+
responseExamples,
|
|
59
|
+
mimeType,
|
|
60
|
+
}): any => {
|
|
61
|
+
let language = "shell";
|
|
62
|
+
if (mimeType.endsWith("json")) language = "json";
|
|
63
|
+
if (mimeType.endsWith("xml")) language = "xml";
|
|
64
|
+
|
|
65
|
+
// Map response examples to an array of TabItem elements
|
|
66
|
+
const examplesArray = Object.entries(responseExamples).map(
|
|
67
|
+
([exampleName, exampleValue]: any) => {
|
|
68
|
+
const isObject = typeof exampleValue.value === "object";
|
|
69
|
+
const responseExample = isObject
|
|
70
|
+
? JSON.stringify(exampleValue.value, null, 2)
|
|
71
|
+
: exampleValue.value;
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
// @ts-ignore
|
|
75
|
+
<TabItem label={exampleName} value={exampleName} key={exampleName}>
|
|
76
|
+
{exampleValue.summary && (
|
|
77
|
+
<Markdown className="openapi-example__summary">
|
|
78
|
+
{exampleValue.summary}
|
|
79
|
+
</Markdown>
|
|
80
|
+
)}
|
|
81
|
+
<ResponseSamples
|
|
82
|
+
responseExample={responseExample}
|
|
83
|
+
language={language}
|
|
84
|
+
/>
|
|
85
|
+
</TabItem>
|
|
86
|
+
);
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
return examplesArray;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
interface ResponseExampleProps {
|
|
94
|
+
responseExample: any;
|
|
95
|
+
mimeType: string;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export const ResponseExample: React.FC<ResponseExampleProps> = ({
|
|
99
|
+
responseExample,
|
|
100
|
+
mimeType,
|
|
101
|
+
}) => {
|
|
102
|
+
let language = "shell";
|
|
103
|
+
if (mimeType.endsWith("json")) {
|
|
104
|
+
language = "json";
|
|
105
|
+
}
|
|
106
|
+
if (mimeType.endsWith("xml")) {
|
|
107
|
+
language = "xml";
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const isObject = typeof responseExample === "object";
|
|
111
|
+
const exampleContent = isObject
|
|
112
|
+
? JSON.stringify(responseExample, null, 2)
|
|
113
|
+
: responseExample;
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
// @ts-ignore
|
|
117
|
+
<TabItem label="Example" value="Example">
|
|
118
|
+
{responseExample.summary && (
|
|
119
|
+
<Markdown className="openapi-example__summary">
|
|
120
|
+
{responseExample.summary}
|
|
121
|
+
</Markdown>
|
|
122
|
+
)}
|
|
123
|
+
<ResponseSamples responseExample={exampleContent} language={language} />
|
|
124
|
+
</TabItem>
|
|
125
|
+
);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
interface ExampleFromSchemaProps {
|
|
129
|
+
schema: any;
|
|
130
|
+
mimeType: string;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export const ExampleFromSchema: React.FC<ExampleFromSchemaProps> = ({
|
|
134
|
+
schema,
|
|
135
|
+
mimeType,
|
|
136
|
+
}) => {
|
|
137
|
+
const responseExample = sampleResponseFromSchema(schema);
|
|
138
|
+
|
|
139
|
+
if (mimeType.endsWith("xml")) {
|
|
140
|
+
let responseExampleObject;
|
|
141
|
+
try {
|
|
142
|
+
responseExampleObject = JSON.parse(JSON.stringify(responseExample));
|
|
143
|
+
} catch {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
if (typeof responseExampleObject === "object") {
|
|
148
|
+
let xmlExample;
|
|
149
|
+
try {
|
|
150
|
+
xmlExample = format(json2xml(responseExampleObject, ""), {
|
|
151
|
+
indentation: " ",
|
|
152
|
+
lineSeparator: "\n",
|
|
153
|
+
collapseContent: true,
|
|
154
|
+
});
|
|
155
|
+
} catch {
|
|
156
|
+
const xmlExampleWithRoot = { root: responseExampleObject };
|
|
157
|
+
try {
|
|
158
|
+
xmlExample = format(json2xml(xmlExampleWithRoot, ""), {
|
|
159
|
+
indentation: " ",
|
|
160
|
+
lineSeparator: "\n",
|
|
161
|
+
collapseContent: true,
|
|
162
|
+
});
|
|
163
|
+
} catch {
|
|
164
|
+
xmlExample = json2xml(responseExampleObject, "");
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return (
|
|
168
|
+
// @ts-ignore
|
|
169
|
+
<TabItem label="Example (auto)" value="Example (auto)">
|
|
170
|
+
<ResponseSamples responseExample={xmlExample} language="xml" />
|
|
171
|
+
</TabItem>
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if (
|
|
177
|
+
typeof responseExample === "object" ||
|
|
178
|
+
typeof responseExample === "string"
|
|
179
|
+
) {
|
|
180
|
+
return (
|
|
181
|
+
// @ts-ignore
|
|
182
|
+
<TabItem label="Example (auto)" value="Example (auto)">
|
|
183
|
+
<ResponseSamples
|
|
184
|
+
responseExample={JSON.stringify(responseExample, null, 2)}
|
|
185
|
+
language="json"
|
|
186
|
+
/>
|
|
187
|
+
</TabItem>
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
return null;
|
|
192
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* Copyright (c) Palo Alto Networks
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
import SchemaItem from "@theme/SchemaItem";
|
|
11
|
+
|
|
12
|
+
import { getQualifierMessage, getSchemaName } from "../../markdown/schema";
|
|
13
|
+
|
|
14
|
+
interface ResponseHeadersProps {
|
|
15
|
+
description?: string;
|
|
16
|
+
example?: string;
|
|
17
|
+
schema?: {
|
|
18
|
+
type?: string;
|
|
19
|
+
format?: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const ResponseHeaders: React.FC<{
|
|
24
|
+
responseHeaders?: Record<string, ResponseHeadersProps>;
|
|
25
|
+
}> = ({ responseHeaders }) => {
|
|
26
|
+
if (!responseHeaders) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<ul style={{ marginLeft: "1rem" }}>
|
|
32
|
+
{Object.entries(responseHeaders).map(([name, schema]) => {
|
|
33
|
+
return (
|
|
34
|
+
<SchemaItem
|
|
35
|
+
name={name}
|
|
36
|
+
collapsible={false}
|
|
37
|
+
schemaName={getSchemaName(schema)}
|
|
38
|
+
qualifierMessage={getQualifierMessage(schema)}
|
|
39
|
+
schema={schema}
|
|
40
|
+
discriminator={false}
|
|
41
|
+
children={null}
|
|
42
|
+
/>
|
|
43
|
+
);
|
|
44
|
+
})}
|
|
45
|
+
</ul>
|
|
46
|
+
);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default ResponseHeaders;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* Copyright (c) Palo Alto Networks
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
import CodeBlock from "@theme/CodeBlock";
|
|
11
|
+
import { Language } from "prism-react-renderer";
|
|
12
|
+
|
|
13
|
+
export interface Props {
|
|
14
|
+
readonly responseExample: string;
|
|
15
|
+
readonly language: Language;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function ResponseSamples({
|
|
19
|
+
responseExample,
|
|
20
|
+
language,
|
|
21
|
+
}: Props): React.JSX.Element {
|
|
22
|
+
return (
|
|
23
|
+
<div className="openapi-code__response-samples-container">
|
|
24
|
+
<CodeBlock language={language ? language : "json"}>
|
|
25
|
+
{responseExample}
|
|
26
|
+
</CodeBlock>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export default ResponseSamples;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/* ============================================================================
|
|
2
|
+
* Copyright (c) Palo Alto Networks
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the MIT license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
* ========================================================================== */
|
|
7
|
+
|
|
8
|
+
import React from "react";
|
|
9
|
+
|
|
10
|
+
import BrowserOnly from "@docusaurus/BrowserOnly";
|
|
11
|
+
import Details from "@theme/Details";
|
|
12
|
+
import Markdown from "@theme/Markdown";
|
|
13
|
+
import MimeTabs from "@theme/MimeTabs"; // Assume these components exist
|
|
14
|
+
import {
|
|
15
|
+
ExampleFromSchema,
|
|
16
|
+
ResponseExample,
|
|
17
|
+
ResponseExamples,
|
|
18
|
+
} from "@theme/ResponseExamples";
|
|
19
|
+
import SchemaNode from "@theme/Schema";
|
|
20
|
+
import SchemaTabs from "@theme/SchemaTabs";
|
|
21
|
+
import SkeletonLoader from "@theme/SkeletonLoader";
|
|
22
|
+
import TabItem from "@theme/TabItem";
|
|
23
|
+
import { MediaTypeObject } from "docusaurus-plugin-openapi-docs/lib/openapi/types";
|
|
24
|
+
|
|
25
|
+
interface Props {
|
|
26
|
+
style?: React.CSSProperties;
|
|
27
|
+
title: string;
|
|
28
|
+
body: {
|
|
29
|
+
content?: {
|
|
30
|
+
[key: string]: MediaTypeObject;
|
|
31
|
+
};
|
|
32
|
+
description?: string;
|
|
33
|
+
required?: string[] | boolean;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const ResponseSchemaComponent: React.FC<Props> = ({
|
|
38
|
+
title,
|
|
39
|
+
body,
|
|
40
|
+
style,
|
|
41
|
+
}): any => {
|
|
42
|
+
if (
|
|
43
|
+
body === undefined ||
|
|
44
|
+
body.content === undefined ||
|
|
45
|
+
Object.keys(body).length === 0 ||
|
|
46
|
+
Object.keys(body.content).length === 0
|
|
47
|
+
) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// Get all MIME types, including vendor-specific
|
|
52
|
+
const mimeTypes = Object.keys(body.content);
|
|
53
|
+
if (mimeTypes && mimeTypes.length) {
|
|
54
|
+
return (
|
|
55
|
+
<MimeTabs className="openapi-tabs__mime" schemaType="response">
|
|
56
|
+
{mimeTypes.map((mimeType: any) => {
|
|
57
|
+
const responseExamples = body.content![mimeType].examples;
|
|
58
|
+
const responseExample = body.content![mimeType].example;
|
|
59
|
+
const firstBody: any =
|
|
60
|
+
body.content![mimeType].schema ?? body.content![mimeType];
|
|
61
|
+
|
|
62
|
+
if (
|
|
63
|
+
firstBody === undefined &&
|
|
64
|
+
responseExample === undefined &&
|
|
65
|
+
responseExamples === undefined
|
|
66
|
+
) {
|
|
67
|
+
return undefined;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (firstBody) {
|
|
71
|
+
return (
|
|
72
|
+
// @ts-ignore
|
|
73
|
+
<TabItem key={mimeType} label={mimeType} value={mimeType}>
|
|
74
|
+
<SchemaTabs className="openapi-tabs__schema">
|
|
75
|
+
{/* @ts-ignore */}
|
|
76
|
+
<TabItem key={title} label={title} value={title}>
|
|
77
|
+
<Details
|
|
78
|
+
className="openapi-markdown__details response"
|
|
79
|
+
data-collapsed={false}
|
|
80
|
+
open={true}
|
|
81
|
+
style={style}
|
|
82
|
+
summary={
|
|
83
|
+
<>
|
|
84
|
+
<summary>
|
|
85
|
+
<strong className="openapi-markdown__details-summary-response">
|
|
86
|
+
{title}
|
|
87
|
+
{body.required === true && (
|
|
88
|
+
<span className="openapi-schema__required">
|
|
89
|
+
required
|
|
90
|
+
</span>
|
|
91
|
+
)}
|
|
92
|
+
</strong>
|
|
93
|
+
</summary>
|
|
94
|
+
</>
|
|
95
|
+
}
|
|
96
|
+
>
|
|
97
|
+
<div style={{ textAlign: "left", marginLeft: "1rem" }}>
|
|
98
|
+
{body.description && (
|
|
99
|
+
<div
|
|
100
|
+
style={{ marginTop: "1rem", marginBottom: "1rem" }}
|
|
101
|
+
>
|
|
102
|
+
<Markdown>{body.description}</Markdown>
|
|
103
|
+
</div>
|
|
104
|
+
)}
|
|
105
|
+
</div>
|
|
106
|
+
<ul style={{ marginLeft: "1rem" }}>
|
|
107
|
+
<SchemaNode schema={firstBody} schemaType="response" />
|
|
108
|
+
</ul>
|
|
109
|
+
</Details>
|
|
110
|
+
</TabItem>
|
|
111
|
+
{firstBody &&
|
|
112
|
+
ExampleFromSchema({
|
|
113
|
+
schema: firstBody,
|
|
114
|
+
mimeType: mimeType,
|
|
115
|
+
})}
|
|
116
|
+
|
|
117
|
+
{responseExamples &&
|
|
118
|
+
ResponseExamples({ responseExamples, mimeType })}
|
|
119
|
+
|
|
120
|
+
{responseExample &&
|
|
121
|
+
ResponseExample({ responseExample, mimeType })}
|
|
122
|
+
</SchemaTabs>
|
|
123
|
+
</TabItem>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
126
|
+
return undefined;
|
|
127
|
+
})}
|
|
128
|
+
</MimeTabs>
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
return undefined;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const ResponseSchema: React.FC<Props> = (props) => {
|
|
135
|
+
return (
|
|
136
|
+
<BrowserOnly fallback={<SkeletonLoader size="md" />}>
|
|
137
|
+
{() => {
|
|
138
|
+
return <ResponseSchemaComponent {...props} />;
|
|
139
|
+
}}
|
|
140
|
+
</BrowserOnly>
|
|
141
|
+
);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
export default ResponseSchema;
|