docusaurus-theme-openapi-docs 4.5.1 → 4.7.0
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/lib/markdown/schema.js +14 -1
- package/lib/theme/ApiExplorer/Accept/slice.d.ts +5 -2
- package/lib/theme/ApiExplorer/Authorization/index.js +50 -9
- package/lib/theme/ApiExplorer/Authorization/slice.d.ts +145 -3
- package/lib/theme/ApiExplorer/Authorization/slice.js +3 -1
- package/lib/theme/ApiExplorer/Body/FileArrayFormBodyItem/index.d.ts +7 -0
- package/lib/theme/ApiExplorer/Body/FileArrayFormBodyItem/index.js +126 -0
- package/lib/theme/ApiExplorer/Body/FormBodyItem/index.d.ts +9 -0
- package/lib/theme/ApiExplorer/Body/FormBodyItem/index.js +110 -0
- package/lib/theme/ApiExplorer/Body/index.js +322 -193
- package/lib/theme/ApiExplorer/Body/resolveSchemaWithSelections.d.ts +13 -0
- package/lib/theme/ApiExplorer/Body/resolveSchemaWithSelections.js +133 -0
- package/lib/theme/ApiExplorer/Body/slice.d.ts +1056 -11
- package/lib/theme/ApiExplorer/Body/slice.js +22 -2
- package/lib/theme/ApiExplorer/CodeSnippets/index.d.ts +2 -1
- package/lib/theme/ApiExplorer/CodeSnippets/index.js +37 -26
- package/lib/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +5 -1
- package/lib/theme/ApiExplorer/CodeTabs/index.d.ts +3 -3
- package/lib/theme/ApiExplorer/CodeTabs/index.js +2 -2
- package/lib/theme/ApiExplorer/ContentType/slice.d.ts +5 -2
- package/lib/theme/ApiExplorer/FormFileUpload/index.js +6 -1
- package/lib/theme/ApiExplorer/FormItem/index.js +6 -1
- package/lib/theme/ApiExplorer/FormTextInput/index.d.ts +2 -0
- package/lib/theme/ApiExplorer/FormTextInput/index.js +8 -1
- package/lib/theme/ApiExplorer/LiveEditor/index.js +11 -4
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +15 -5
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +11 -3
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +12 -4
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +11 -2
- package/lib/theme/ApiExplorer/ParamOptions/index.js +11 -1
- package/lib/theme/ApiExplorer/ParamOptions/slice.d.ts +0 -4
- package/lib/theme/ApiExplorer/ParamOptions/slice.js +4 -4
- package/lib/theme/ApiExplorer/Request/index.js +110 -17
- package/lib/theme/ApiExplorer/Request/makeRequest.d.ts +7 -1
- package/lib/theme/ApiExplorer/Request/makeRequest.js +94 -24
- package/lib/theme/ApiExplorer/Response/index.js +34 -14
- package/lib/theme/ApiExplorer/Response/slice.d.ts +31 -7
- package/lib/theme/ApiExplorer/SchemaSelection/index.d.ts +2 -0
- package/lib/theme/ApiExplorer/SchemaSelection/index.js +36 -0
- package/lib/theme/ApiExplorer/SchemaSelection/slice.d.ts +37 -0
- package/lib/theme/ApiExplorer/SchemaSelection/slice.js +39 -0
- package/lib/theme/ApiExplorer/SecuritySchemes/index.js +208 -69
- package/lib/theme/ApiExplorer/Server/index.js +16 -2
- package/lib/theme/ApiExplorer/Server/slice.d.ts +49 -3
- package/lib/theme/ApiExplorer/buildPostmanRequest.js +46 -57
- package/lib/theme/ApiExplorer/index.js +4 -0
- package/lib/theme/ApiExplorer/persistenceMiddleware.d.ts +21 -0
- package/lib/theme/ApiExplorer/{persistanceMiddleware.js → persistenceMiddleware.js} +16 -9
- package/lib/theme/ApiExplorer/storage-utils.d.ts +2 -2
- package/lib/theme/ApiExplorer/storage-utils.js +3 -3
- package/lib/theme/ApiItem/Layout/index.d.ts +1 -1
- package/lib/theme/ApiItem/hooks.d.ts +10 -9
- package/lib/theme/ApiItem/index.js +13 -8
- package/lib/theme/ApiItem/store.d.ts +61 -43
- package/lib/theme/ApiItem/store.js +6 -2
- package/lib/theme/ApiTabs/index.js +6 -1
- package/lib/theme/Example/_Example.scss +11 -0
- package/lib/theme/Example/index.d.ts +24 -0
- package/lib/theme/Example/index.js +170 -0
- package/lib/theme/ParamsDetails/index.js +9 -1
- package/lib/theme/ParamsItem/index.d.ts +1 -1
- package/lib/theme/ParamsItem/index.js +43 -74
- package/lib/theme/RequestSchema/index.js +68 -48
- package/lib/theme/ResponseExamples/index.js +23 -3
- package/lib/theme/ResponseSchema/index.js +97 -82
- package/lib/theme/Schema/index.d.ts +6 -0
- package/lib/theme/Schema/index.js +240 -31
- package/lib/theme/SchemaItem/index.js +64 -36
- package/lib/theme/SchemaTabs/index.d.ts +8 -1
- package/lib/theme/SchemaTabs/index.js +14 -2
- package/lib/theme/StatusCodes/index.d.ts +1 -1
- package/lib/theme/StatusCodes/index.js +11 -2
- package/lib/theme/styles.scss +15 -0
- package/lib/theme/translationIds.d.ts +90 -0
- package/lib/theme/translationIds.js +114 -0
- package/package.json +28 -28
- package/src/markdown/schema.ts +17 -1
- package/src/theme/ApiExplorer/Authorization/index.tsx +51 -10
- package/src/theme/ApiExplorer/Authorization/slice.ts +1 -1
- package/src/theme/ApiExplorer/Body/FileArrayFormBodyItem/index.tsx +77 -0
- package/src/theme/ApiExplorer/Body/FormBodyItem/index.tsx +120 -0
- package/src/theme/ApiExplorer/Body/index.tsx +262 -198
- package/{lib/types.js → src/theme/ApiExplorer/Body/json2xml.d.ts} +2 -2
- package/src/theme/ApiExplorer/Body/resolveSchemaWithSelections.ts +155 -0
- package/src/theme/ApiExplorer/Body/slice.ts +40 -1
- package/src/theme/ApiExplorer/CodeSnippets/index.tsx +43 -29
- package/src/theme/ApiExplorer/CodeTabs/_CodeTabs.scss +5 -1
- package/src/theme/ApiExplorer/CodeTabs/index.tsx +6 -5
- package/src/theme/ApiExplorer/ContentType/index.tsx +1 -1
- package/src/theme/ApiExplorer/FormFileUpload/index.tsx +6 -1
- package/src/theme/ApiExplorer/FormItem/index.tsx +8 -1
- package/src/theme/ApiExplorer/FormTextInput/index.tsx +10 -1
- package/src/theme/ApiExplorer/LiveEditor/index.tsx +11 -4
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +16 -6
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +12 -4
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +12 -4
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +12 -3
- package/src/theme/ApiExplorer/ParamOptions/index.tsx +10 -2
- package/src/theme/ApiExplorer/ParamOptions/slice.ts +1 -1
- package/src/theme/ApiExplorer/Request/index.tsx +108 -17
- package/src/theme/ApiExplorer/Request/makeRequest.ts +106 -25
- package/src/theme/ApiExplorer/Response/index.tsx +30 -8
- package/src/theme/ApiExplorer/SchemaSelection/index.ts +13 -0
- package/src/theme/ApiExplorer/SchemaSelection/slice.ts +46 -0
- package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +157 -69
- package/src/theme/ApiExplorer/Server/index.tsx +12 -4
- package/src/theme/ApiExplorer/buildPostmanRequest.ts +47 -63
- package/src/theme/ApiExplorer/index.tsx +5 -0
- package/src/theme/ApiExplorer/{persistanceMiddleware.ts → persistenceMiddleware.ts} +23 -13
- package/src/theme/ApiExplorer/storage-utils.ts +4 -4
- package/src/theme/ApiItem/Layout/index.tsx +1 -1
- package/src/theme/ApiItem/index.tsx +13 -7
- package/src/theme/ApiItem/store.ts +2 -0
- package/src/theme/ApiTabs/index.tsx +6 -1
- package/src/theme/Example/_Example.scss +11 -0
- package/src/theme/Example/index.tsx +168 -0
- package/src/theme/Markdown/index.d.ts +8 -0
- package/src/theme/ParamsDetails/index.tsx +10 -1
- package/src/theme/ParamsItem/index.tsx +38 -54
- package/src/theme/RequestSchema/index.tsx +60 -35
- package/src/theme/ResponseExamples/index.tsx +23 -3
- package/src/theme/ResponseSchema/index.tsx +73 -61
- package/src/theme/Schema/index.tsx +307 -55
- package/src/theme/SchemaItem/index.tsx +51 -33
- package/src/theme/SchemaTabs/index.tsx +19 -5
- package/src/theme/StatusCodes/index.tsx +13 -3
- package/src/theme/styles.scss +15 -0
- package/src/theme/translationIds.ts +111 -0
- package/src/theme-openapi.d.ts +7 -275
- package/src/{types.ts → types.d.ts} +9 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/lib/theme/ApiExplorer/persistanceMiddleware.d.ts +0 -3
- package/lib/types.d.ts +0 -46
|
@@ -7,7 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
import React, { ReactNode } from "react";
|
|
9
9
|
|
|
10
|
+
import { translate } from "@docusaurus/Translate";
|
|
11
|
+
import { Example } from "@theme/Example";
|
|
10
12
|
import Markdown from "@theme/Markdown";
|
|
13
|
+
import { OPENAPI_SCHEMA_ITEM } from "@theme/translationIds";
|
|
11
14
|
import clsx from "clsx";
|
|
12
15
|
|
|
13
16
|
import { guard } from "../../markdown/utils";
|
|
@@ -36,7 +39,15 @@ const transformEnumDescriptions = (
|
|
|
36
39
|
|
|
37
40
|
const getEnumDescriptionMarkdown = (enumDescriptions?: [string, string][]) => {
|
|
38
41
|
if (enumDescriptions?.length) {
|
|
39
|
-
|
|
42
|
+
const enumValue = translate({
|
|
43
|
+
id: OPENAPI_SCHEMA_ITEM.ENUM_VALUE,
|
|
44
|
+
message: "Enum Value",
|
|
45
|
+
});
|
|
46
|
+
const description = translate({
|
|
47
|
+
id: OPENAPI_SCHEMA_ITEM.ENUM_DESCRIPTION,
|
|
48
|
+
message: "Description",
|
|
49
|
+
});
|
|
50
|
+
return `| ${enumValue} | ${description} |
|
|
40
51
|
| ---- | ----- |
|
|
41
52
|
${enumDescriptions
|
|
42
53
|
.map((desc) => {
|
|
@@ -63,6 +74,7 @@ export default function SchemaItem(props: Props) {
|
|
|
63
74
|
let schemaDescription;
|
|
64
75
|
let defaultValue: string | undefined;
|
|
65
76
|
let example: string | undefined;
|
|
77
|
+
let examples: string[] | undefined;
|
|
66
78
|
let nullable;
|
|
67
79
|
let enumDescriptions: [string, string][] = [];
|
|
68
80
|
let constValue: string | undefined;
|
|
@@ -73,6 +85,7 @@ export default function SchemaItem(props: Props) {
|
|
|
73
85
|
enumDescriptions = transformEnumDescriptions(schema["x-enumDescriptions"]);
|
|
74
86
|
defaultValue = schema.default;
|
|
75
87
|
example = schema.example;
|
|
88
|
+
examples = schema.examples;
|
|
76
89
|
nullable =
|
|
77
90
|
schema.nullable ||
|
|
78
91
|
(Array.isArray(schema.type) && schema.type.includes("null")); // support JSON Schema nullable
|
|
@@ -81,15 +94,23 @@ export default function SchemaItem(props: Props) {
|
|
|
81
94
|
|
|
82
95
|
const renderRequired = guard(
|
|
83
96
|
Array.isArray(required) ? required.includes(name) : required,
|
|
84
|
-
() =>
|
|
97
|
+
() => (
|
|
98
|
+
<span className="openapi-schema__required">
|
|
99
|
+
{translate({ id: OPENAPI_SCHEMA_ITEM.REQUIRED, message: "required" })}
|
|
100
|
+
</span>
|
|
101
|
+
)
|
|
85
102
|
);
|
|
86
103
|
|
|
87
104
|
const renderDeprecated = guard(deprecated, () => (
|
|
88
|
-
<span className="openapi-schema__deprecated">
|
|
105
|
+
<span className="openapi-schema__deprecated">
|
|
106
|
+
{translate({ id: OPENAPI_SCHEMA_ITEM.DEPRECATED, message: "deprecated" })}
|
|
107
|
+
</span>
|
|
89
108
|
));
|
|
90
109
|
|
|
91
110
|
const renderNullable = guard(nullable, () => (
|
|
92
|
-
<span className="openapi-schema__nullable">
|
|
111
|
+
<span className="openapi-schema__nullable">
|
|
112
|
+
{translate({ id: OPENAPI_SCHEMA_ITEM.NULLABLE, message: "nullable" })}
|
|
113
|
+
</span>
|
|
93
114
|
));
|
|
94
115
|
|
|
95
116
|
const renderEnumDescriptions = guard(
|
|
@@ -120,7 +141,12 @@ export default function SchemaItem(props: Props) {
|
|
|
120
141
|
if (typeof defaultValue === "string") {
|
|
121
142
|
return (
|
|
122
143
|
<div>
|
|
123
|
-
<strong>
|
|
144
|
+
<strong>
|
|
145
|
+
{translate({
|
|
146
|
+
id: OPENAPI_SCHEMA_ITEM.DEFAULT_VALUE,
|
|
147
|
+
message: "Default value:",
|
|
148
|
+
})}{" "}
|
|
149
|
+
</strong>
|
|
124
150
|
<span>
|
|
125
151
|
<code>{defaultValue}</code>
|
|
126
152
|
</span>
|
|
@@ -129,7 +155,12 @@ export default function SchemaItem(props: Props) {
|
|
|
129
155
|
}
|
|
130
156
|
return (
|
|
131
157
|
<div>
|
|
132
|
-
<strong>
|
|
158
|
+
<strong>
|
|
159
|
+
{translate({
|
|
160
|
+
id: OPENAPI_SCHEMA_ITEM.DEFAULT_VALUE,
|
|
161
|
+
message: "Default value:",
|
|
162
|
+
})}{" "}
|
|
163
|
+
</strong>
|
|
133
164
|
<span>
|
|
134
165
|
<code>{JSON.stringify(defaultValue)}</code>
|
|
135
166
|
</span>
|
|
@@ -139,36 +170,17 @@ export default function SchemaItem(props: Props) {
|
|
|
139
170
|
return undefined;
|
|
140
171
|
}
|
|
141
172
|
|
|
142
|
-
function renderExample() {
|
|
143
|
-
if (example !== undefined) {
|
|
144
|
-
if (typeof example === "string") {
|
|
145
|
-
return (
|
|
146
|
-
<div>
|
|
147
|
-
<strong>Example: </strong>
|
|
148
|
-
<span>
|
|
149
|
-
<code>{example}</code>
|
|
150
|
-
</span>
|
|
151
|
-
</div>
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
return (
|
|
155
|
-
<div>
|
|
156
|
-
<strong>Example: </strong>
|
|
157
|
-
<span>
|
|
158
|
-
<code>{JSON.stringify(example)}</code>
|
|
159
|
-
</span>
|
|
160
|
-
</div>
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
return undefined;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
173
|
function renderConstValue() {
|
|
167
174
|
if (constValue !== undefined) {
|
|
168
175
|
if (typeof constValue === "string") {
|
|
169
176
|
return (
|
|
170
177
|
<div>
|
|
171
|
-
<strong>
|
|
178
|
+
<strong>
|
|
179
|
+
{translate({
|
|
180
|
+
id: OPENAPI_SCHEMA_ITEM.CONSTANT_VALUE,
|
|
181
|
+
message: "Constant value:",
|
|
182
|
+
})}{" "}
|
|
183
|
+
</strong>
|
|
172
184
|
<span>
|
|
173
185
|
<code>{constValue}</code>
|
|
174
186
|
</span>
|
|
@@ -177,7 +189,12 @@ export default function SchemaItem(props: Props) {
|
|
|
177
189
|
}
|
|
178
190
|
return (
|
|
179
191
|
<div>
|
|
180
|
-
<strong>
|
|
192
|
+
<strong>
|
|
193
|
+
{translate({
|
|
194
|
+
id: OPENAPI_SCHEMA_ITEM.CONSTANT_VALUE,
|
|
195
|
+
message: "Constant value:",
|
|
196
|
+
})}{" "}
|
|
197
|
+
</strong>
|
|
181
198
|
<span>
|
|
182
199
|
<code>{JSON.stringify(constValue)}</code>
|
|
183
200
|
</span>
|
|
@@ -212,7 +229,8 @@ export default function SchemaItem(props: Props) {
|
|
|
212
229
|
{renderQualifierMessage}
|
|
213
230
|
{renderConstValue()}
|
|
214
231
|
{renderDefaultValue()}
|
|
215
|
-
{
|
|
232
|
+
<Example example={example} />
|
|
233
|
+
<Example examples={examples} />
|
|
216
234
|
{collapsibleSchemaContent ?? collapsibleSchemaContent}
|
|
217
235
|
</div>
|
|
218
236
|
);
|
|
@@ -25,13 +25,22 @@ import useIsBrowser from "@docusaurus/useIsBrowser";
|
|
|
25
25
|
import clsx from "clsx";
|
|
26
26
|
import flatten from "lodash/flatten";
|
|
27
27
|
|
|
28
|
+
export interface SchemaTabsProps extends TabProps {
|
|
29
|
+
/**
|
|
30
|
+
* Optional callback fired when the selected tab changes.
|
|
31
|
+
* Receives the index of the newly selected tab.
|
|
32
|
+
*/
|
|
33
|
+
onChange?: (index: number) => void;
|
|
34
|
+
}
|
|
35
|
+
|
|
28
36
|
function TabList({
|
|
29
37
|
className,
|
|
30
38
|
block,
|
|
31
39
|
selectedValue,
|
|
32
40
|
selectValue,
|
|
33
41
|
tabValues,
|
|
34
|
-
|
|
42
|
+
onChange,
|
|
43
|
+
}: SchemaTabsProps & ReturnType<typeof useTabs>) {
|
|
35
44
|
const tabRefs: (HTMLLIElement | null)[] = [];
|
|
36
45
|
const { blockElementScrollPositionUntilNextRender } =
|
|
37
46
|
useScrollPositionBlocker();
|
|
@@ -49,6 +58,8 @@ function TabList({
|
|
|
49
58
|
if (newTabValue !== selectedValue) {
|
|
50
59
|
blockElementScrollPositionUntilNextRender(newTab);
|
|
51
60
|
selectValue(newTabValue);
|
|
61
|
+
// Notify parent component of the tab change
|
|
62
|
+
onChange?.(newTabIndex);
|
|
52
63
|
}
|
|
53
64
|
};
|
|
54
65
|
|
|
@@ -115,7 +126,10 @@ function TabList({
|
|
|
115
126
|
};
|
|
116
127
|
|
|
117
128
|
return (
|
|
118
|
-
<div
|
|
129
|
+
<div
|
|
130
|
+
className="openapi-tabs__schema-tabs-container"
|
|
131
|
+
style={{ marginBottom: "1rem" }}
|
|
132
|
+
>
|
|
119
133
|
{showTabArrows && (
|
|
120
134
|
<button
|
|
121
135
|
className="openapi-tabs__arrow left"
|
|
@@ -174,7 +188,7 @@ function TabContent({
|
|
|
174
188
|
lazy,
|
|
175
189
|
children,
|
|
176
190
|
selectedValue,
|
|
177
|
-
}:
|
|
191
|
+
}: SchemaTabsProps & ReturnType<typeof useTabs>) {
|
|
178
192
|
const childTabs = (Array.isArray(children) ? children : [children]).filter(
|
|
179
193
|
Boolean
|
|
180
194
|
) as ReactElement<TabItemProps>[];
|
|
@@ -200,7 +214,7 @@ function TabContent({
|
|
|
200
214
|
</div>
|
|
201
215
|
);
|
|
202
216
|
}
|
|
203
|
-
function TabsComponent(props:
|
|
217
|
+
function TabsComponent(props: SchemaTabsProps): React.JSX.Element {
|
|
204
218
|
const tabs = useTabs(props);
|
|
205
219
|
return (
|
|
206
220
|
<div className="openapi-tabs__schema-container">
|
|
@@ -209,7 +223,7 @@ function TabsComponent(props: TabProps): React.JSX.Element {
|
|
|
209
223
|
</div>
|
|
210
224
|
);
|
|
211
225
|
}
|
|
212
|
-
export default function SchemaTabs(props:
|
|
226
|
+
export default function SchemaTabs(props: SchemaTabsProps): React.JSX.Element {
|
|
213
227
|
const isBrowser = useIsBrowser();
|
|
214
228
|
return (
|
|
215
229
|
<TabsComponent
|
|
@@ -7,13 +7,15 @@
|
|
|
7
7
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
|
+
import { translate } from "@docusaurus/Translate";
|
|
10
11
|
import ApiTabs from "@theme/ApiTabs";
|
|
11
12
|
import Details from "@theme/Details";
|
|
12
13
|
import Markdown from "@theme/Markdown";
|
|
13
14
|
import ResponseHeaders from "@theme/ResponseHeaders";
|
|
14
15
|
import ResponseSchema from "@theme/ResponseSchema";
|
|
15
16
|
import TabItem from "@theme/TabItem";
|
|
16
|
-
import {
|
|
17
|
+
import { OPENAPI_STATUS_CODES } from "@theme/translationIds";
|
|
18
|
+
import { ApiItem } from "docusaurus-plugin-openapi-docs/src/types";
|
|
17
19
|
|
|
18
20
|
interface Props {
|
|
19
21
|
id?: string;
|
|
@@ -51,7 +53,12 @@ const StatusCodes: React.FC<Props> = ({ label, id, responses }: any) => {
|
|
|
51
53
|
style={{ textAlign: "left", marginBottom: "1rem" }}
|
|
52
54
|
summary={
|
|
53
55
|
<summary>
|
|
54
|
-
<strong>
|
|
56
|
+
<strong>
|
|
57
|
+
{translate({
|
|
58
|
+
id: OPENAPI_STATUS_CODES.RESPONSE_HEADERS,
|
|
59
|
+
message: "Response Headers",
|
|
60
|
+
})}
|
|
61
|
+
</strong>
|
|
55
62
|
</summary>
|
|
56
63
|
}
|
|
57
64
|
>
|
|
@@ -59,7 +66,10 @@ const StatusCodes: React.FC<Props> = ({ label, id, responses }: any) => {
|
|
|
59
66
|
</Details>
|
|
60
67
|
)}
|
|
61
68
|
<ResponseSchema
|
|
62
|
-
title=
|
|
69
|
+
title={translate({
|
|
70
|
+
id: OPENAPI_STATUS_CODES.SCHEMA_TITLE,
|
|
71
|
+
message: "Schema",
|
|
72
|
+
})}
|
|
63
73
|
body={{ content: response.content }}
|
|
64
74
|
/>
|
|
65
75
|
</TabItem>
|
package/src/theme/styles.scss
CHANGED
|
@@ -41,6 +41,8 @@
|
|
|
41
41
|
@use "./CodeSamples/CodeSamples";
|
|
42
42
|
/* Markdown Styling */
|
|
43
43
|
@use "./Markdown/Details/Details";
|
|
44
|
+
/* Example Styling */
|
|
45
|
+
@use "./Example/Example";
|
|
44
46
|
|
|
45
47
|
:root {
|
|
46
48
|
--openapi-required: var(--ifm-color-danger);
|
|
@@ -67,6 +69,9 @@
|
|
|
67
69
|
--openapi-code-tab-border-color-java: #0374bd;
|
|
68
70
|
--openapi-code-tab-border-color-powershell: #00adef;
|
|
69
71
|
--openapi-code-tab-shadow-color-python: rgba(255, 219, 80, 0.25);
|
|
72
|
+
--openapi-code-tab-shadow-color-curl: var(
|
|
73
|
+
--openapi-code-tab-shadow-color-bash
|
|
74
|
+
);
|
|
70
75
|
--openapi-code-tab-shadow-color-bash: rgba(250, 56, 62, 0.25);
|
|
71
76
|
--openapi-code-tab-shadow-color-go: rgba(84, 199, 236, 0.25);
|
|
72
77
|
--openapi-code-tab-shadow-color-js: rgba(255, 186, 0, 0.25);
|
|
@@ -161,6 +166,16 @@
|
|
|
161
166
|
border-right: thin solid var(--ifm-toc-border-color);
|
|
162
167
|
}
|
|
163
168
|
|
|
169
|
+
@media (min-width: 997px) {
|
|
170
|
+
.openapi-right-panel__container {
|
|
171
|
+
position: sticky;
|
|
172
|
+
top: calc(var(--ifm-navbar-height) + 1rem);
|
|
173
|
+
max-height: calc(100vh - var(--ifm-navbar-height) - 2rem);
|
|
174
|
+
overflow-y: auto;
|
|
175
|
+
align-self: flex-start;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
|
|
164
179
|
@media (max-width: 997px) {
|
|
165
180
|
.schema {
|
|
166
181
|
margin-bottom: 1rem;
|
|
@@ -0,0 +1,111 @@
|
|
|
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
|
+
export const OPENAPI_RESPONSE = {
|
|
9
|
+
TITLE: "theme.openapi.response.title",
|
|
10
|
+
CLEAR: "theme.openapi.response.clear",
|
|
11
|
+
PLACEHOLDER: "theme.openapi.response.placeholder",
|
|
12
|
+
HEADERS_TAB: "theme.openapi.response.headersTab",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const OPENAPI_TABS = {
|
|
16
|
+
RESPONSES_LABEL: "theme.openapi.tabs.responses.label",
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const OPENAPI_REQUEST = {
|
|
20
|
+
BODY_TITLE: "theme.openapi.request.body.title",
|
|
21
|
+
ACCEPT_TITLE: "theme.openapi.request.accept.title",
|
|
22
|
+
SEND_BUTTON: "theme.openapi.request.sendButton",
|
|
23
|
+
REQUIRED_LABEL: "theme.openapi.request.requiredLabel",
|
|
24
|
+
REQUEST_TITLE: "theme.openapi.request.title",
|
|
25
|
+
COLLAPSE_ALL: "theme.openapi.request.collapseAll",
|
|
26
|
+
EXPAND_ALL: "theme.openapi.request.expandAll",
|
|
27
|
+
BASE_URL_TITLE: "theme.openapi.request.baseUrl.title",
|
|
28
|
+
AUTH_TITLE: "theme.openapi.request.auth.title",
|
|
29
|
+
PARAMETERS_TITLE: "theme.openapi.request.parameters.title",
|
|
30
|
+
FETCHING_MESSAGE: "theme.openapi.request.fetchingMessage",
|
|
31
|
+
CONNECTION_FAILED: "theme.openapi.request.connectionFailed",
|
|
32
|
+
ERROR_TIMEOUT: "theme.openapi.request.error.timeout",
|
|
33
|
+
ERROR_NETWORK: "theme.openapi.request.error.network",
|
|
34
|
+
ERROR_CORS: "theme.openapi.request.error.cors",
|
|
35
|
+
ERROR_UNKNOWN: "theme.openapi.request.error.unknown",
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const OPENAPI_SERVER = {
|
|
39
|
+
EDIT_BUTTON: "theme.openapi.server.editButton",
|
|
40
|
+
HIDE_BUTTON: "theme.openapi.server.hideButton",
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const OPENAPI_PARAM_OPTIONS = {
|
|
44
|
+
SHOW_OPTIONAL: "theme.openapi.paramOptions.showOptional",
|
|
45
|
+
HIDE_OPTIONAL: "theme.openapi.paramOptions.hideOptional",
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export const OPENAPI_FORM_FILE_UPLOAD = {
|
|
49
|
+
CLEAR_BUTTON: "theme.openapi.formFileUpload.clearButton",
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const OPENAPI_FORM = {
|
|
53
|
+
FIELD_REQUIRED: "theme.openapi.form.fieldRequired",
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const OPENAPI_AUTH = {
|
|
57
|
+
BEARER_TOKEN: "theme.openapi.auth.bearerToken",
|
|
58
|
+
USERNAME: "theme.openapi.auth.username",
|
|
59
|
+
PASSWORD: "theme.openapi.auth.password",
|
|
60
|
+
SECURITY_SCHEME: "theme.openapi.auth.securityScheme",
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const OPENAPI_RESPONSE_EXAMPLES = {
|
|
64
|
+
EXAMPLE: "theme.openapi.responseExamples.example",
|
|
65
|
+
AUTO_EXAMPLE: "theme.openapi.responseExamples.autoExample",
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const OPENAPI_BODY = {
|
|
69
|
+
EXAMPLE_FROM_SCHEMA: "theme.openapi.body.exampleFromSchema",
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export const OPENAPI_STATUS_CODES = {
|
|
73
|
+
RESPONSE_HEADERS: "theme.openapi.statusCodes.responseHeaders",
|
|
74
|
+
SCHEMA_TITLE: "theme.openapi.statusCodes.schemaTitle",
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const OPENAPI_SCHEMA = {
|
|
78
|
+
NO_SCHEMA: "theme.openapi.schema.noSchema",
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const OPENAPI_SCHEMA_ITEM = {
|
|
82
|
+
REQUIRED: "theme.openapi.schemaItem.required",
|
|
83
|
+
DEPRECATED: "theme.openapi.schemaItem.deprecated",
|
|
84
|
+
NULLABLE: "theme.openapi.schemaItem.nullable",
|
|
85
|
+
DEFAULT_VALUE: "theme.openapi.schemaItem.defaultValue",
|
|
86
|
+
EXAMPLE: "theme.openapi.schemaItem.example",
|
|
87
|
+
EXAMPLES: "theme.openapi.schemaItem.examples",
|
|
88
|
+
DESCRIPTION: "theme.openapi.schemaItem.description",
|
|
89
|
+
CONSTANT_VALUE: "theme.openapi.schemaItem.constantValue",
|
|
90
|
+
ENUM_VALUE: "theme.openapi.schemaItem.enumValue",
|
|
91
|
+
ENUM_DESCRIPTION: "theme.openapi.schemaItem.enumDescription",
|
|
92
|
+
POSSIBLE_VALUES: "theme.openapi.schemaItem.possibleValues",
|
|
93
|
+
ONE_OF: "theme.openapi.schemaItem.oneOf",
|
|
94
|
+
ANY_OF: "theme.openapi.schemaItem.anyOf",
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
export const OPENAPI_PARAMS_DETAILS = {
|
|
98
|
+
PARAMETERS_TITLE: "theme.openapi.paramsDetails.parametersTitle",
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export const OPENAPI_SECURITY_SCHEMES = {
|
|
102
|
+
NAME: "theme.openapi.securitySchemes.name",
|
|
103
|
+
TYPE: "theme.openapi.securitySchemes.type",
|
|
104
|
+
SCOPES: "theme.openapi.securitySchemes.scopes",
|
|
105
|
+
IN: "theme.openapi.securitySchemes.in",
|
|
106
|
+
FLOWS: "theme.openapi.securitySchemes.flows",
|
|
107
|
+
DESCRIPTION: "theme.openapi.securitySchemes.description",
|
|
108
|
+
SCHEME: "theme.openapi.securitySchemes.scheme",
|
|
109
|
+
BEARER_FORMAT: "theme.openapi.securitySchemes.bearerFormat",
|
|
110
|
+
OPEN_ID_CONNECT_URL: "theme.openapi.securitySchemes.openIdConnectUrl",
|
|
111
|
+
};
|