docusaurus-theme-openapi-docs 1.5.1 → 1.6.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/index.js +2 -11
- package/lib/markdown/utils.js +18 -1
- package/lib/theme/ApiDemoPanel/Curl/index.js +36 -9
- package/lib/theme/ApiDemoPanel/Curl/styles.module.css +5 -0
- package/lib/theme/ApiDemoPanel/Request/index.js +3 -2
- package/lib/theme/ApiDemoPanel/SecuritySchemes/index.js +195 -9
- package/lib/theme/ApiLogo/index.js +24 -1
- package/lib/theme/ParamsItem/index.js +33 -6
- package/lib/theme/SchemaItem/index.js +26 -12
- package/lib/theme/SchemaItem/styles.module.css +5 -0
- package/lib/theme/SchemaTabs/index.js +2 -2
- package/lib/theme/SchemaTabs/styles.module.css +5 -0
- package/lib/theme/styles.css +57 -2
- package/lib-next/index.js +2 -13
- package/lib-next/markdown/utils.js +17 -1
- package/lib-next/theme/ApiDemoPanel/Curl/index.js +37 -8
- package/lib-next/theme/ApiDemoPanel/Curl/styles.module.css +5 -0
- package/lib-next/theme/ApiDemoPanel/Request/index.js +4 -2
- package/lib-next/theme/ApiDemoPanel/SecuritySchemes/index.js +210 -9
- package/lib-next/theme/ApiLogo/index.js +35 -9
- package/lib-next/theme/ParamsItem/index.js +33 -6
- package/lib-next/theme/SchemaItem/index.js +26 -12
- package/lib-next/theme/SchemaItem/styles.module.css +5 -0
- package/lib-next/theme/SchemaTabs/index.js +2 -2
- package/lib-next/theme/SchemaTabs/styles.module.css +5 -0
- package/lib-next/theme/styles.css +57 -2
- package/package.json +8 -7
- package/src/index.ts +3 -13
- package/src/markdown/utils.ts +18 -1
- package/src/theme/ApiDemoPanel/Curl/index.tsx +36 -8
- package/src/theme/ApiDemoPanel/Curl/styles.module.css +5 -0
- package/src/theme/ApiDemoPanel/Request/index.tsx +4 -2
- package/src/theme/ApiDemoPanel/SecuritySchemes/index.tsx +213 -9
- package/src/theme/ApiLogo/index.tsx +37 -10
- package/src/theme/ParamsItem/index.js +33 -6
- package/src/theme/SchemaItem/index.js +26 -12
- package/src/theme/SchemaItem/styles.module.css +5 -0
- package/src/theme/SchemaTabs/index.js +2 -2
- package/src/theme/SchemaTabs/styles.module.css +5 -0
- package/src/theme/styles.css +57 -2
|
@@ -17,6 +17,10 @@ function SecuritySchemes(props: any) {
|
|
|
17
17
|
|
|
18
18
|
if (selected === undefined) return null;
|
|
19
19
|
|
|
20
|
+
if (options[selected]?.[0]?.type === undefined) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
|
|
20
24
|
const selectedAuth = options[selected];
|
|
21
25
|
return (
|
|
22
26
|
<details className={`details__demo-panel`} open={false}>
|
|
@@ -24,11 +28,94 @@ function SecuritySchemes(props: any) {
|
|
|
24
28
|
<h4>Authorization</h4>
|
|
25
29
|
</summary>
|
|
26
30
|
{selectedAuth.map((auth: any) => {
|
|
31
|
+
const isHttp = auth.type === "http";
|
|
27
32
|
const isApiKey = auth.type === "apiKey";
|
|
28
|
-
const isBearer = auth.type === "http" && auth.key === "Bearer";
|
|
29
33
|
const isOauth2 = auth.type === "oauth2";
|
|
34
|
+
const isOpenId = auth.type === "openIdConnect";
|
|
30
35
|
|
|
31
|
-
if (
|
|
36
|
+
if (isHttp) {
|
|
37
|
+
if (auth.scheme === "bearer") {
|
|
38
|
+
const { name, key, type, scopes, ...rest } = auth;
|
|
39
|
+
return (
|
|
40
|
+
<React.Fragment key={auth.key}>
|
|
41
|
+
<pre
|
|
42
|
+
style={{
|
|
43
|
+
display: "flex",
|
|
44
|
+
flexDirection: "column",
|
|
45
|
+
background: "var(--openapi-card-background-color)",
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
<span>
|
|
49
|
+
<strong>name:</strong>{" "}
|
|
50
|
+
<Link to={infoAuthPath}>{name ?? key}</Link>
|
|
51
|
+
</span>
|
|
52
|
+
<span>
|
|
53
|
+
<strong>type: </strong>
|
|
54
|
+
{type}
|
|
55
|
+
</span>
|
|
56
|
+
{scopes && scopes.length > 0 && (
|
|
57
|
+
<span>
|
|
58
|
+
<strong>scopes: </strong>
|
|
59
|
+
<code>
|
|
60
|
+
{auth.scopes.length > 0 ? auth.scopes.toString() : "[]"}
|
|
61
|
+
</code>
|
|
62
|
+
</span>
|
|
63
|
+
)}
|
|
64
|
+
{Object.keys(rest).map((k, i) => {
|
|
65
|
+
return (
|
|
66
|
+
<span key={k}>
|
|
67
|
+
<strong>{k}: </strong>
|
|
68
|
+
{typeof rest[k] === "object"
|
|
69
|
+
? JSON.stringify(rest[k], null, 2)
|
|
70
|
+
: String(rest[k])}
|
|
71
|
+
</span>
|
|
72
|
+
);
|
|
73
|
+
})}
|
|
74
|
+
</pre>
|
|
75
|
+
</React.Fragment>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
78
|
+
if (auth.scheme === "basic") {
|
|
79
|
+
const { name, key, type, scopes, ...rest } = auth;
|
|
80
|
+
return (
|
|
81
|
+
<React.Fragment key={auth.key}>
|
|
82
|
+
<pre
|
|
83
|
+
style={{
|
|
84
|
+
display: "flex",
|
|
85
|
+
flexDirection: "column",
|
|
86
|
+
background: "var(--openapi-card-background-color)",
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
<span>
|
|
90
|
+
<strong>name:</strong>{" "}
|
|
91
|
+
<Link to={infoAuthPath}>{name ?? key}</Link>
|
|
92
|
+
</span>
|
|
93
|
+
<span>
|
|
94
|
+
<strong>type: </strong>
|
|
95
|
+
{type}
|
|
96
|
+
</span>
|
|
97
|
+
{scopes && scopes.length > 0 && (
|
|
98
|
+
<span>
|
|
99
|
+
<strong>scopes: </strong>
|
|
100
|
+
<code>
|
|
101
|
+
{auth.scopes.length > 0 ? auth.scopes.toString() : "[]"}
|
|
102
|
+
</code>
|
|
103
|
+
</span>
|
|
104
|
+
)}
|
|
105
|
+
{Object.keys(rest).map((k, i) => {
|
|
106
|
+
return (
|
|
107
|
+
<span key={k}>
|
|
108
|
+
<strong>{k}: </strong>
|
|
109
|
+
{typeof rest[k] === "object"
|
|
110
|
+
? JSON.stringify(rest[k], null, 2)
|
|
111
|
+
: String(rest[k])}
|
|
112
|
+
</span>
|
|
113
|
+
);
|
|
114
|
+
})}
|
|
115
|
+
</pre>
|
|
116
|
+
</React.Fragment>
|
|
117
|
+
);
|
|
118
|
+
}
|
|
32
119
|
return (
|
|
33
120
|
<React.Fragment key={auth.key}>
|
|
34
121
|
<pre
|
|
@@ -38,17 +125,67 @@ function SecuritySchemes(props: any) {
|
|
|
38
125
|
background: "var(--openapi-card-background-color)",
|
|
39
126
|
}}
|
|
40
127
|
>
|
|
41
|
-
<span>type: {auth.type}</span>
|
|
42
128
|
<span>
|
|
43
|
-
|
|
129
|
+
<strong>name:</strong>{" "}
|
|
130
|
+
<Link to={infoAuthPath}>{auth.name ?? auth.key}</Link>
|
|
131
|
+
</span>
|
|
132
|
+
<span>
|
|
133
|
+
<strong>type: </strong>
|
|
134
|
+
{auth.type}
|
|
135
|
+
</span>
|
|
136
|
+
<span>
|
|
137
|
+
<strong>in: </strong>
|
|
138
|
+
{auth.in}
|
|
44
139
|
</span>
|
|
45
|
-
|
|
140
|
+
</pre>
|
|
141
|
+
</React.Fragment>
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
if (isApiKey) {
|
|
146
|
+
const { name, key, type, scopes, ...rest } = auth;
|
|
147
|
+
return (
|
|
148
|
+
<React.Fragment key={auth.key}>
|
|
149
|
+
<pre
|
|
150
|
+
style={{
|
|
151
|
+
display: "flex",
|
|
152
|
+
flexDirection: "column",
|
|
153
|
+
background: "var(--openapi-card-background-color)",
|
|
154
|
+
}}
|
|
155
|
+
>
|
|
156
|
+
<span>
|
|
157
|
+
<strong>name:</strong>{" "}
|
|
158
|
+
<Link to={infoAuthPath}>{name ?? key}</Link>
|
|
159
|
+
</span>
|
|
160
|
+
<span>
|
|
161
|
+
<strong>type: </strong>
|
|
162
|
+
{type}
|
|
163
|
+
</span>
|
|
164
|
+
{scopes && scopes.length > 0 && (
|
|
165
|
+
<span>
|
|
166
|
+
<strong>scopes: </strong>
|
|
167
|
+
<code>
|
|
168
|
+
{auth.scopes.length > 0 ? auth.scopes.toString() : "[]"}
|
|
169
|
+
</code>
|
|
170
|
+
</span>
|
|
171
|
+
)}
|
|
172
|
+
{Object.keys(rest).map((k, i) => {
|
|
173
|
+
return (
|
|
174
|
+
<span key={k}>
|
|
175
|
+
<strong>{k}: </strong>
|
|
176
|
+
{typeof rest[k] === "object"
|
|
177
|
+
? JSON.stringify(rest[k], null, 2)
|
|
178
|
+
: String(rest[k])}
|
|
179
|
+
</span>
|
|
180
|
+
);
|
|
181
|
+
})}
|
|
46
182
|
</pre>
|
|
47
183
|
</React.Fragment>
|
|
48
184
|
);
|
|
49
185
|
}
|
|
50
186
|
|
|
51
187
|
if (isOauth2) {
|
|
188
|
+
const { name, key, type, scopes, flows, ...rest } = auth;
|
|
52
189
|
return (
|
|
53
190
|
<React.Fragment key={selected}>
|
|
54
191
|
<pre
|
|
@@ -59,14 +196,81 @@ function SecuritySchemes(props: any) {
|
|
|
59
196
|
}}
|
|
60
197
|
>
|
|
61
198
|
<span>
|
|
62
|
-
|
|
199
|
+
<strong>name:</strong>{" "}
|
|
200
|
+
<Link to={infoAuthPath}>{name ?? key}</Link>
|
|
201
|
+
</span>
|
|
202
|
+
<span>
|
|
203
|
+
<strong>type: </strong>
|
|
204
|
+
{type}
|
|
63
205
|
</span>
|
|
64
|
-
{
|
|
65
|
-
|
|
206
|
+
{scopes && scopes.length > 0 && (
|
|
207
|
+
<span>
|
|
208
|
+
<strong>scopes: </strong>
|
|
209
|
+
<code>
|
|
210
|
+
{auth.scopes.length > 0 ? auth.scopes.toString() : "[]"}
|
|
211
|
+
</code>
|
|
212
|
+
</span>
|
|
213
|
+
)}
|
|
214
|
+
{Object.keys(rest).map((k, i) => {
|
|
215
|
+
return (
|
|
216
|
+
<span key={k}>
|
|
217
|
+
<strong>{k}: </strong>
|
|
218
|
+
{typeof rest[k] === "object"
|
|
219
|
+
? JSON.stringify(rest[k], null, 2)
|
|
220
|
+
: String(rest[k])}
|
|
221
|
+
</span>
|
|
222
|
+
);
|
|
66
223
|
})}
|
|
224
|
+
{flows && (
|
|
225
|
+
<span>
|
|
226
|
+
<code>
|
|
227
|
+
<strong>flows: </strong>
|
|
228
|
+
{JSON.stringify(flows, null, 2)}
|
|
229
|
+
</code>
|
|
230
|
+
</span>
|
|
231
|
+
)}
|
|
232
|
+
</pre>
|
|
233
|
+
</React.Fragment>
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
if (isOpenId) {
|
|
238
|
+
const { name, key, scopes, type, ...rest } = auth;
|
|
239
|
+
return (
|
|
240
|
+
<React.Fragment key={auth.key}>
|
|
241
|
+
<pre
|
|
242
|
+
style={{
|
|
243
|
+
display: "flex",
|
|
244
|
+
flexDirection: "column",
|
|
245
|
+
background: "var(--openapi-card-background-color)",
|
|
246
|
+
}}
|
|
247
|
+
>
|
|
67
248
|
<span>
|
|
68
|
-
|
|
249
|
+
<strong>name:</strong>{" "}
|
|
250
|
+
<Link to={infoAuthPath}>{name ?? key}</Link>
|
|
69
251
|
</span>
|
|
252
|
+
<span>
|
|
253
|
+
<strong>type: </strong>
|
|
254
|
+
{type}
|
|
255
|
+
</span>
|
|
256
|
+
{scopes && scopes.length > 0 && (
|
|
257
|
+
<span>
|
|
258
|
+
<strong>scopes: </strong>
|
|
259
|
+
<code>
|
|
260
|
+
{auth.scopes.length > 0 ? auth.scopes.toString() : "[]"}
|
|
261
|
+
</code>
|
|
262
|
+
</span>
|
|
263
|
+
)}
|
|
264
|
+
{Object.keys(rest).map((k, i) => {
|
|
265
|
+
return (
|
|
266
|
+
<span key={k}>
|
|
267
|
+
<strong>{k}: </strong>
|
|
268
|
+
{typeof rest[k] === "object"
|
|
269
|
+
? JSON.stringify(rest[k], null, 2)
|
|
270
|
+
: String(rest[k])}
|
|
271
|
+
</span>
|
|
272
|
+
);
|
|
273
|
+
})}
|
|
70
274
|
</pre>
|
|
71
275
|
</React.Fragment>
|
|
72
276
|
);
|
|
@@ -8,18 +8,45 @@
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
10
|
import { useColorMode } from "@docusaurus/theme-common";
|
|
11
|
+
import useBaseUrl from "@docusaurus/useBaseUrl";
|
|
12
|
+
import ThemedImage from "@theme/ThemedImage";
|
|
11
13
|
|
|
12
|
-
export default function ApiLogo(props: any): JSX.Element {
|
|
14
|
+
export default function ApiLogo(props: any): JSX.Element | undefined {
|
|
13
15
|
const { colorMode } = useColorMode();
|
|
14
16
|
const { logo, darkLogo } = props;
|
|
17
|
+
const altText = () => {
|
|
18
|
+
if (colorMode === "dark") {
|
|
19
|
+
return darkLogo?.altText ?? logo?.altText;
|
|
20
|
+
}
|
|
21
|
+
return logo?.altText;
|
|
22
|
+
};
|
|
23
|
+
const lightLogoUrl = useBaseUrl(logo?.url);
|
|
24
|
+
const darkLogoUrl = useBaseUrl(darkLogo?.url);
|
|
15
25
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
if (logo && darkLogo) {
|
|
27
|
+
return (
|
|
28
|
+
<ThemedImage
|
|
29
|
+
alt={altText()}
|
|
30
|
+
sources={{
|
|
31
|
+
light: lightLogoUrl,
|
|
32
|
+
dark: darkLogoUrl,
|
|
33
|
+
}}
|
|
34
|
+
className="openapi__logo"
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
if (logo || darkLogo) {
|
|
39
|
+
return (
|
|
40
|
+
<ThemedImage
|
|
41
|
+
alt={altText()}
|
|
42
|
+
sources={{
|
|
43
|
+
light: lightLogoUrl ?? darkLogoUrl,
|
|
44
|
+
dark: lightLogoUrl ?? darkLogoUrl,
|
|
45
|
+
}}
|
|
46
|
+
className="openapi__logo"
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return undefined;
|
|
25
52
|
}
|
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
import React from "react";
|
|
9
9
|
|
|
10
10
|
import CodeBlock from "@theme/CodeBlock";
|
|
11
|
+
import SchemaTabs from "@theme/SchemaTabs";
|
|
12
|
+
import TabItem from "@theme/TabItem";
|
|
11
13
|
/* eslint-disable import/no-extraneous-dependencies*/
|
|
12
14
|
import { createDescription } from "docusaurus-theme-openapi-docs/lib/markdown/createDescription";
|
|
13
15
|
/* eslint-disable import/no-extraneous-dependencies*/
|
|
@@ -16,7 +18,10 @@ import {
|
|
|
16
18
|
getSchemaName,
|
|
17
19
|
} from "docusaurus-theme-openapi-docs/lib/markdown/schema";
|
|
18
20
|
/* eslint-disable import/no-extraneous-dependencies*/
|
|
19
|
-
import {
|
|
21
|
+
import {
|
|
22
|
+
guard,
|
|
23
|
+
toString,
|
|
24
|
+
} from "docusaurus-theme-openapi-docs/lib/markdown/utils";
|
|
20
25
|
import ReactMarkdown from "react-markdown";
|
|
21
26
|
import rehypeRaw from "rehype-raw";
|
|
22
27
|
|
|
@@ -25,6 +30,10 @@ import styles from "./styles.module.css";
|
|
|
25
30
|
function ParamsItem({
|
|
26
31
|
param: { description, example, examples, name, required, schema },
|
|
27
32
|
}) {
|
|
33
|
+
if (!schema || !schema?.type) {
|
|
34
|
+
schema = { type: "any" };
|
|
35
|
+
}
|
|
36
|
+
|
|
28
37
|
const renderSchemaName = guard(schema, (schema) => (
|
|
29
38
|
<span className={styles.schemaName}> {getSchemaName(schema)}</span>
|
|
30
39
|
));
|
|
@@ -76,17 +85,35 @@ function ParamsItem({
|
|
|
76
85
|
)
|
|
77
86
|
);
|
|
78
87
|
|
|
79
|
-
const renderExample = guard(example, (example) => (
|
|
80
|
-
<div>
|
|
88
|
+
const renderExample = guard(toString(example), (example) => (
|
|
89
|
+
<div>
|
|
90
|
+
<strong>Example: </strong>
|
|
91
|
+
{example}
|
|
92
|
+
</div>
|
|
81
93
|
));
|
|
82
94
|
|
|
83
95
|
const renderExamples = guard(examples, (examples) => {
|
|
84
96
|
const exampleEntries = Object.entries(examples);
|
|
85
97
|
return (
|
|
86
98
|
<>
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
99
|
+
<strong>Examples:</strong>
|
|
100
|
+
<SchemaTabs>
|
|
101
|
+
{exampleEntries.map(([exampleName, exampleProperties]) => (
|
|
102
|
+
<TabItem value={exampleName} label={exampleName}>
|
|
103
|
+
{exampleProperties.summary && <p>{exampleProperties.summary}</p>}
|
|
104
|
+
{exampleProperties.description && (
|
|
105
|
+
<p>
|
|
106
|
+
<strong>Description: </strong>
|
|
107
|
+
<span>{exampleProperties.description}</span>
|
|
108
|
+
</p>
|
|
109
|
+
)}
|
|
110
|
+
<p>
|
|
111
|
+
<strong>Example: </strong>
|
|
112
|
+
<code>{exampleProperties.value}</code>
|
|
113
|
+
</p>
|
|
114
|
+
</TabItem>
|
|
115
|
+
))}
|
|
116
|
+
</SchemaTabs>
|
|
90
117
|
</>
|
|
91
118
|
);
|
|
92
119
|
});
|
|
@@ -11,7 +11,10 @@ import CodeBlock from "@theme/CodeBlock";
|
|
|
11
11
|
/* eslint-disable import/no-extraneous-dependencies*/
|
|
12
12
|
import { createDescription } from "docusaurus-theme-openapi-docs/lib/markdown/createDescription";
|
|
13
13
|
/* eslint-disable import/no-extraneous-dependencies*/
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
guard,
|
|
16
|
+
toString,
|
|
17
|
+
} from "docusaurus-theme-openapi-docs/lib/markdown/utils";
|
|
15
18
|
import ReactMarkdown from "react-markdown";
|
|
16
19
|
import rehypeRaw from "rehype-raw";
|
|
17
20
|
|
|
@@ -23,11 +26,20 @@ function SchemaItem({
|
|
|
23
26
|
name,
|
|
24
27
|
qualifierMessage,
|
|
25
28
|
required,
|
|
26
|
-
deprecated,
|
|
27
|
-
schemaDescription,
|
|
28
29
|
schemaName,
|
|
29
|
-
|
|
30
|
+
schema,
|
|
30
31
|
}) {
|
|
32
|
+
let deprecated;
|
|
33
|
+
let schemaDescription;
|
|
34
|
+
let defaultValue;
|
|
35
|
+
let nullable;
|
|
36
|
+
if (schema) {
|
|
37
|
+
deprecated = schema.deprecated;
|
|
38
|
+
schemaDescription = schema.description;
|
|
39
|
+
defaultValue = schema.default;
|
|
40
|
+
nullable = schema.nullable;
|
|
41
|
+
}
|
|
42
|
+
|
|
31
43
|
const renderRequired = guard(
|
|
32
44
|
Array.isArray(required) ? required.includes(name) : required,
|
|
33
45
|
() => <strong className={styles.required}> required</strong>
|
|
@@ -37,6 +49,10 @@ function SchemaItem({
|
|
|
37
49
|
<strong className={styles.deprecated}> deprecated</strong>
|
|
38
50
|
));
|
|
39
51
|
|
|
52
|
+
const renderNullable = guard(nullable, () => (
|
|
53
|
+
<strong className={styles.nullable}> nullable</strong>
|
|
54
|
+
));
|
|
55
|
+
|
|
40
56
|
const renderSchemaDescription = guard(schemaDescription, (description) => (
|
|
41
57
|
<div>
|
|
42
58
|
<ReactMarkdown
|
|
@@ -67,19 +83,17 @@ function SchemaItem({
|
|
|
67
83
|
</div>
|
|
68
84
|
));
|
|
69
85
|
|
|
70
|
-
const renderDefaultValue = guard(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</div>
|
|
76
|
-
)
|
|
77
|
-
);
|
|
86
|
+
const renderDefaultValue = guard(toString(defaultValue), (value) => (
|
|
87
|
+
<div className={styles.schemaQualifierMessage}>
|
|
88
|
+
<ReactMarkdown children={`**Default value:** \`${value}\``} />
|
|
89
|
+
</div>
|
|
90
|
+
));
|
|
78
91
|
|
|
79
92
|
const schemaContent = (
|
|
80
93
|
<div>
|
|
81
94
|
<strong className={deprecated && styles.strikethrough}>{name}</strong>
|
|
82
95
|
<span className={styles.schemaName}> {schemaName}</span>
|
|
96
|
+
{renderNullable}
|
|
83
97
|
{!deprecated && renderRequired}
|
|
84
98
|
{renderDeprecated}
|
|
85
99
|
{renderQualifierMessage}
|
|
@@ -241,11 +241,11 @@ function SchemaTabsComponent(props) {
|
|
|
241
241
|
(tabItem) => tabItem.props.value === defaultValue
|
|
242
242
|
)[0],
|
|
243
243
|
{
|
|
244
|
-
className:
|
|
244
|
+
className: styles.marginVertical,
|
|
245
245
|
}
|
|
246
246
|
)
|
|
247
247
|
) : (
|
|
248
|
-
<div className=
|
|
248
|
+
<div className={styles.marginVertical}>
|
|
249
249
|
{children.map((tabItem, i) =>
|
|
250
250
|
cloneElement(tabItem, {
|
|
251
251
|
key: i,
|
package/src/theme/styles.css
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
:root {
|
|
9
9
|
--openapi-required: var(--ifm-color-danger);
|
|
10
10
|
--openapi-deprecated: var(--ifm-color-warning);
|
|
11
|
+
--openapi-nullable: var(--ifm-color-info);
|
|
11
12
|
--openapi-code-blue: var(--ifm-color-info);
|
|
12
13
|
--openapi-code-red: var(--ifm-color-danger);
|
|
13
14
|
--openapi-code-orange: var(--ifm-color-warning);
|
|
@@ -77,10 +78,14 @@
|
|
|
77
78
|
|
|
78
79
|
.theme-api-markdown details li {
|
|
79
80
|
list-style: none;
|
|
80
|
-
padding-bottom: 5px;
|
|
81
81
|
padding-top: 5px;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
.theme-api-markdown .tabs__item {
|
|
85
|
+
padding-bottom: unset;
|
|
86
|
+
padding-top: unset;
|
|
87
|
+
}
|
|
88
|
+
|
|
84
89
|
.theme-api-markdown details > div > div {
|
|
85
90
|
padding-top: unset !important;
|
|
86
91
|
border-top: unset !important;
|
|
@@ -244,6 +249,8 @@
|
|
|
244
249
|
color: var(--ifm-color-success);
|
|
245
250
|
padding-left: 1.4rem;
|
|
246
251
|
padding-right: 1.4rem;
|
|
252
|
+
padding-top: 1rem !important;
|
|
253
|
+
padding-bottom: 1rem !important;
|
|
247
254
|
}
|
|
248
255
|
|
|
249
256
|
.code__tab--python.tabs__item--active {
|
|
@@ -268,6 +275,8 @@
|
|
|
268
275
|
color: var(--ifm-color-info);
|
|
269
276
|
padding-left: 1.4rem;
|
|
270
277
|
padding-right: 1.4rem;
|
|
278
|
+
padding-top: 1rem !important;
|
|
279
|
+
padding-bottom: 1rem !important;
|
|
271
280
|
}
|
|
272
281
|
|
|
273
282
|
.code__tab--go.tabs__item--active {
|
|
@@ -292,6 +301,8 @@
|
|
|
292
301
|
color: var(--ifm-color-warning);
|
|
293
302
|
padding-left: 1.4rem;
|
|
294
303
|
padding-right: 1.4rem;
|
|
304
|
+
padding-top: 1rem !important;
|
|
305
|
+
padding-bottom: 1rem !important;
|
|
295
306
|
}
|
|
296
307
|
|
|
297
308
|
.code__tab--javascript.tabs__item--active {
|
|
@@ -316,6 +327,8 @@
|
|
|
316
327
|
color: var(--ifm-color-danger);
|
|
317
328
|
padding-left: 1.4rem;
|
|
318
329
|
padding-right: 1.4rem;
|
|
330
|
+
padding-top: 1rem !important;
|
|
331
|
+
padding-bottom: 1rem !important;
|
|
319
332
|
}
|
|
320
333
|
|
|
321
334
|
.code__tab--bash.tabs__item--active {
|
|
@@ -340,6 +353,8 @@
|
|
|
340
353
|
color: var(--ifm-color-danger);
|
|
341
354
|
padding-left: 1.4rem;
|
|
342
355
|
padding-right: 1.4rem;
|
|
356
|
+
padding-top: 1rem !important;
|
|
357
|
+
padding-bottom: 1rem !important;
|
|
343
358
|
}
|
|
344
359
|
|
|
345
360
|
.code__tab--ruby.tabs__item--active {
|
|
@@ -364,6 +379,8 @@
|
|
|
364
379
|
color: var(--ifm-color-gray-500);
|
|
365
380
|
padding-left: 1.4rem;
|
|
366
381
|
padding-right: 1.4rem;
|
|
382
|
+
padding-top: 1rem !important;
|
|
383
|
+
padding-bottom: 1rem !important;
|
|
367
384
|
}
|
|
368
385
|
|
|
369
386
|
.code__tab--csharp.tabs__item--active {
|
|
@@ -388,6 +405,8 @@
|
|
|
388
405
|
color: var(--ifm-color-success);
|
|
389
406
|
padding-left: 1.4rem;
|
|
390
407
|
padding-right: 1.4rem;
|
|
408
|
+
padding-top: 1rem !important;
|
|
409
|
+
padding-bottom: 1rem !important;
|
|
391
410
|
}
|
|
392
411
|
|
|
393
412
|
.code__tab--nodejs.tabs__item--active {
|
|
@@ -412,6 +431,8 @@
|
|
|
412
431
|
color: var(--ifm-color-gray-500);
|
|
413
432
|
padding-left: 1.4rem;
|
|
414
433
|
padding-right: 1.4rem;
|
|
434
|
+
padding-top: 1rem !important;
|
|
435
|
+
padding-bottom: 1rem !important;
|
|
415
436
|
}
|
|
416
437
|
|
|
417
438
|
.code__tab--php.tabs__item--active {
|
|
@@ -424,7 +445,41 @@
|
|
|
424
445
|
overflow: auto;
|
|
425
446
|
}
|
|
426
447
|
|
|
448
|
+
.code__tab--java::after {
|
|
449
|
+
content: "";
|
|
450
|
+
width: 28px;
|
|
451
|
+
height: 28px;
|
|
452
|
+
background: url("https://raw.githubusercontent.com/devicons/devicon/master/icons/java/java-original.svg");
|
|
453
|
+
margin-block: auto;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
.code__tab--java {
|
|
457
|
+
color: var(--ifm-color-warning);
|
|
458
|
+
padding-left: 1.4rem;
|
|
459
|
+
padding-right: 1.4rem;
|
|
460
|
+
padding-top: 1rem !important;
|
|
461
|
+
padding-bottom: 1rem !important;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
.code__tab--java.tabs__item--active {
|
|
465
|
+
border-bottom-color: var(--ifm-color-warning);
|
|
466
|
+
background-color: var(--ifm-color-emphasis-100);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
.language-java {
|
|
470
|
+
max-height: 500px;
|
|
471
|
+
overflow: auto;
|
|
472
|
+
}
|
|
473
|
+
|
|
427
474
|
/* Prism code styles */
|
|
428
|
-
.prism-code.language-
|
|
475
|
+
.prism-code.language-java {
|
|
429
476
|
white-space: pre !important;
|
|
430
477
|
}
|
|
478
|
+
|
|
479
|
+
.openapi__logo {
|
|
480
|
+
width: 250px;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
div:has(> ul.openapi-tabs__security-schemes) {
|
|
484
|
+
max-width: 100%;
|
|
485
|
+
}
|