docusaurus-theme-openapi-docs 0.0.0-1293 → 0.0.0-1295
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 +38 -15
- package/lib/markdown/schema.test.js +35 -0
- package/lib/theme/ApiExplorer/Authorization/index.js +9 -10
- package/lib/theme/ApiExplorer/Body/index.js +4 -5
- package/lib/theme/ApiExplorer/Export/index.js +9 -2
- package/lib/theme/ApiExplorer/FormFileUpload/index.js +1 -2
- package/lib/theme/ApiExplorer/FormLabel/index.js +1 -2
- package/lib/theme/ApiExplorer/FormTextInput/index.js +1 -2
- package/lib/theme/ApiExplorer/LiveEditor/index.js +1 -2
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.js +5 -3
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.js +1 -2
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.js +1 -2
- package/lib/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.js +1 -2
- package/lib/theme/ApiExplorer/ParamOptions/index.js +2 -3
- package/lib/theme/ApiExplorer/Request/index.js +17 -18
- package/lib/theme/ApiExplorer/Response/index.js +7 -11
- package/lib/theme/ApiExplorer/SecuritySchemes/index.js +57 -50
- package/lib/theme/ApiExplorer/Server/index.js +2 -3
- package/lib/theme/ApiTabs/index.js +1 -2
- package/lib/theme/Example/index.js +3 -4
- package/lib/theme/ParamsDetails/index.js +1 -2
- package/lib/theme/ParamsItem/index.js +7 -8
- package/lib/theme/RequestSchema/index.js +4 -6
- package/lib/theme/ResponseExamples/index.js +3 -4
- package/lib/theme/ResponseSchema/index.js +2 -3
- package/lib/theme/Schema/index.js +8 -9
- package/lib/theme/SchemaExpansion/index.js +4 -5
- package/lib/theme/SchemaItem/index.js +9 -10
- package/lib/theme/StatusCodes/index.js +2 -4
- package/lib/theme/translationIds.d.ts +1 -99
- package/lib/theme/translationIds.js +0 -116
- package/package.json +3 -3
- package/src/markdown/schema.test.ts +41 -0
- package/src/markdown/schema.ts +42 -15
- package/src/theme/ApiExplorer/Authorization/index.tsx +9 -10
- package/src/theme/ApiExplorer/Body/index.tsx +7 -5
- package/src/theme/ApiExplorer/Export/index.tsx +6 -2
- package/src/theme/ApiExplorer/FormFileUpload/index.tsx +1 -2
- package/src/theme/ApiExplorer/FormLabel/index.tsx +1 -2
- package/src/theme/ApiExplorer/FormTextInput/index.tsx +1 -2
- package/src/theme/ApiExplorer/LiveEditor/index.tsx +1 -2
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamArrayFormItem.tsx +5 -3
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamBooleanFormItem.tsx +1 -2
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamMultiSelectFormItem.tsx +1 -2
- package/src/theme/ApiExplorer/ParamOptions/ParamFormItems/ParamSelectFormItem.tsx +1 -2
- package/src/theme/ApiExplorer/ParamOptions/index.tsx +2 -3
- package/src/theme/ApiExplorer/Request/index.tsx +23 -18
- package/src/theme/ApiExplorer/Response/index.tsx +10 -8
- package/src/theme/ApiExplorer/SecuritySchemes/index.tsx +60 -52
- package/src/theme/ApiExplorer/Server/index.tsx +8 -3
- package/src/theme/ApiTabs/index.tsx +1 -2
- package/src/theme/Example/index.tsx +3 -4
- package/src/theme/ParamsDetails/index.tsx +1 -2
- package/src/theme/ParamsItem/index.tsx +13 -8
- package/src/theme/RequestSchema/index.tsx +4 -5
- package/src/theme/ResponseExamples/index.tsx +3 -4
- package/src/theme/ResponseSchema/index.tsx +2 -3
- package/src/theme/Schema/index.tsx +8 -9
- package/src/theme/SchemaExpansion/index.tsx +4 -5
- package/src/theme/SchemaItem/index.tsx +18 -10
- package/src/theme/StatusCodes/index.tsx +2 -3
- package/src/theme/translationIds.ts +37 -113
|
@@ -80,7 +80,6 @@ const ApiCodeBlock_1 = __importDefault(
|
|
|
80
80
|
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
81
81
|
const SchemaTabs_1 = __importDefault(require("@theme/SchemaTabs"));
|
|
82
82
|
const TabItem_1 = __importDefault(require("@theme/TabItem"));
|
|
83
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
84
83
|
const clsx_1 = __importDefault(require("clsx"));
|
|
85
84
|
const slice_1 = require("./slice");
|
|
86
85
|
// Pretty-print a JSON string by re-indenting structural tokens only.
|
|
@@ -193,7 +192,7 @@ function Response({ item }) {
|
|
|
193
192
|
"span",
|
|
194
193
|
{ className: "openapi-explorer__response-title" },
|
|
195
194
|
(0, Translate_1.translate)({
|
|
196
|
-
id:
|
|
195
|
+
id: "theme.openapi.response.title",
|
|
197
196
|
message: "Response",
|
|
198
197
|
})
|
|
199
198
|
),
|
|
@@ -209,7 +208,7 @@ function Response({ item }) {
|
|
|
209
208
|
},
|
|
210
209
|
},
|
|
211
210
|
(0, Translate_1.translate)({
|
|
212
|
-
id:
|
|
211
|
+
id: "theme.openapi.response.clear",
|
|
213
212
|
message: "Clear",
|
|
214
213
|
})
|
|
215
214
|
)
|
|
@@ -263,17 +262,14 @@ function Response({ item }) {
|
|
|
263
262
|
react_1.default.createElement(
|
|
264
263
|
Translate_1.default,
|
|
265
264
|
{
|
|
266
|
-
id:
|
|
265
|
+
id: "theme.openapi.response.placeholder",
|
|
267
266
|
values: {
|
|
268
267
|
code: react_1.default.createElement(
|
|
269
268
|
"code",
|
|
270
269
|
null,
|
|
271
270
|
react_1.default.createElement(
|
|
272
271
|
Translate_1.default,
|
|
273
|
-
{
|
|
274
|
-
id: translationIds_1.OPENAPI_REQUEST
|
|
275
|
-
.SEND_BUTTON,
|
|
276
|
-
},
|
|
272
|
+
{ id: "theme.openapi.request.sendButton" },
|
|
277
273
|
"Send API Request"
|
|
278
274
|
)
|
|
279
275
|
),
|
|
@@ -288,7 +284,7 @@ function Response({ item }) {
|
|
|
288
284
|
TabItem_1.default,
|
|
289
285
|
{
|
|
290
286
|
label: (0, Translate_1.translate)({
|
|
291
|
-
id:
|
|
287
|
+
id: "theme.openapi.response.headersTab",
|
|
292
288
|
message: "Headers",
|
|
293
289
|
}),
|
|
294
290
|
value: "headers",
|
|
@@ -323,14 +319,14 @@ function Response({ item }) {
|
|
|
323
319
|
react_1.default.createElement(
|
|
324
320
|
Translate_1.default,
|
|
325
321
|
{
|
|
326
|
-
id:
|
|
322
|
+
id: "theme.openapi.response.placeholder",
|
|
327
323
|
values: {
|
|
328
324
|
code: react_1.default.createElement(
|
|
329
325
|
"code",
|
|
330
326
|
null,
|
|
331
327
|
react_1.default.createElement(
|
|
332
328
|
Translate_1.default,
|
|
333
|
-
{ id:
|
|
329
|
+
{ id: "theme.openapi.request.sendButton" },
|
|
334
330
|
"Send API Request"
|
|
335
331
|
)
|
|
336
332
|
),
|
|
@@ -15,7 +15,6 @@ const react_1 = __importDefault(require("react"));
|
|
|
15
15
|
const Link_1 = __importDefault(require("@docusaurus/Link"));
|
|
16
16
|
const Translate_1 = require("@docusaurus/Translate");
|
|
17
17
|
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
18
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
19
18
|
function SecuritySchemes(props) {
|
|
20
19
|
const options = (0, hooks_1.useTypedSelector)((state) => state.auth.options);
|
|
21
20
|
const selected = (0, hooks_1.useTypedSelector)(
|
|
@@ -27,42 +26,46 @@ function SecuritySchemes(props) {
|
|
|
27
26
|
return null;
|
|
28
27
|
}
|
|
29
28
|
const selectedAuth = options[selected];
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
29
|
+
// Each label uses a static `translate()` call (literal id + message) so that
|
|
30
|
+
// `docusaurus write-translations` can statically extract it. A dynamic
|
|
31
|
+
// `translate({ id: someVar })` would be skipped by the extractor.
|
|
32
|
+
const renderRestLabel = (k) => {
|
|
33
|
+
switch (k) {
|
|
34
|
+
case "description":
|
|
35
|
+
return (0, Translate_1.translate)({
|
|
36
|
+
id: "theme.openapi.securitySchemes.description",
|
|
37
|
+
message: "description:",
|
|
38
|
+
});
|
|
39
|
+
case "scheme":
|
|
40
|
+
return (0, Translate_1.translate)({
|
|
41
|
+
id: "theme.openapi.securitySchemes.scheme",
|
|
42
|
+
message: "scheme:",
|
|
43
|
+
});
|
|
44
|
+
case "bearerFormat":
|
|
45
|
+
return (0, Translate_1.translate)({
|
|
46
|
+
id: "theme.openapi.securitySchemes.bearerFormat",
|
|
47
|
+
message: "bearerFormat:",
|
|
48
|
+
});
|
|
49
|
+
case "openIdConnectUrl":
|
|
50
|
+
return (0, Translate_1.translate)({
|
|
51
|
+
id: "theme.openapi.securitySchemes.openIdConnectUrl",
|
|
52
|
+
message: "openIdConnectUrl:",
|
|
53
|
+
});
|
|
54
|
+
default:
|
|
55
|
+
return `${k}:`;
|
|
56
|
+
}
|
|
47
57
|
};
|
|
48
58
|
const renderRest = (rest) =>
|
|
49
|
-
Object.keys(rest).map((k) =>
|
|
50
|
-
|
|
51
|
-
const label = translation
|
|
52
|
-
? (0, Translate_1.translate)({
|
|
53
|
-
id: translation.id,
|
|
54
|
-
message: translation.message,
|
|
55
|
-
})
|
|
56
|
-
: `${k}:`;
|
|
57
|
-
return react_1.default.createElement(
|
|
59
|
+
Object.keys(rest).map((k) =>
|
|
60
|
+
react_1.default.createElement(
|
|
58
61
|
"span",
|
|
59
62
|
{ key: k },
|
|
60
|
-
react_1.default.createElement("strong", null,
|
|
63
|
+
react_1.default.createElement("strong", null, renderRestLabel(k), " "),
|
|
61
64
|
typeof rest[k] === "object"
|
|
62
65
|
? JSON.stringify(rest[k], null, 2)
|
|
63
66
|
: String(rest[k])
|
|
64
|
-
)
|
|
65
|
-
|
|
67
|
+
)
|
|
68
|
+
);
|
|
66
69
|
return react_1.default.createElement(
|
|
67
70
|
"details",
|
|
68
71
|
{ className: "openapi-security__details", open: false },
|
|
@@ -72,7 +75,11 @@ function SecuritySchemes(props) {
|
|
|
72
75
|
react_1.default.createElement(
|
|
73
76
|
"h4",
|
|
74
77
|
{ className: "openapi-security__summary-header" },
|
|
75
|
-
|
|
78
|
+
(0, Translate_1.translate)({
|
|
79
|
+
id: "theme.openapi.securitySchemes.authorization",
|
|
80
|
+
message: "Authorization:",
|
|
81
|
+
}),
|
|
82
|
+
" ",
|
|
76
83
|
selectedAuth[0].name ?? selectedAuth[0].type
|
|
77
84
|
)
|
|
78
85
|
),
|
|
@@ -103,7 +110,7 @@ function SecuritySchemes(props) {
|
|
|
103
110
|
"strong",
|
|
104
111
|
null,
|
|
105
112
|
(0, Translate_1.translate)({
|
|
106
|
-
id:
|
|
113
|
+
id: "theme.openapi.securitySchemes.name",
|
|
107
114
|
message: "name:",
|
|
108
115
|
})
|
|
109
116
|
),
|
|
@@ -121,7 +128,7 @@ function SecuritySchemes(props) {
|
|
|
121
128
|
"strong",
|
|
122
129
|
null,
|
|
123
130
|
(0, Translate_1.translate)({
|
|
124
|
-
id:
|
|
131
|
+
id: "theme.openapi.securitySchemes.type",
|
|
125
132
|
message: "type:",
|
|
126
133
|
})
|
|
127
134
|
),
|
|
@@ -137,7 +144,7 @@ function SecuritySchemes(props) {
|
|
|
137
144
|
"strong",
|
|
138
145
|
null,
|
|
139
146
|
(0, Translate_1.translate)({
|
|
140
|
-
id:
|
|
147
|
+
id: "theme.openapi.securitySchemes.scopes",
|
|
141
148
|
message: "scopes:",
|
|
142
149
|
})
|
|
143
150
|
),
|
|
@@ -173,7 +180,7 @@ function SecuritySchemes(props) {
|
|
|
173
180
|
"strong",
|
|
174
181
|
null,
|
|
175
182
|
(0, Translate_1.translate)({
|
|
176
|
-
id:
|
|
183
|
+
id: "theme.openapi.securitySchemes.name",
|
|
177
184
|
message: "name:",
|
|
178
185
|
})
|
|
179
186
|
),
|
|
@@ -191,7 +198,7 @@ function SecuritySchemes(props) {
|
|
|
191
198
|
"strong",
|
|
192
199
|
null,
|
|
193
200
|
(0, Translate_1.translate)({
|
|
194
|
-
id:
|
|
201
|
+
id: "theme.openapi.securitySchemes.type",
|
|
195
202
|
message: "type:",
|
|
196
203
|
})
|
|
197
204
|
),
|
|
@@ -207,7 +214,7 @@ function SecuritySchemes(props) {
|
|
|
207
214
|
"strong",
|
|
208
215
|
null,
|
|
209
216
|
(0, Translate_1.translate)({
|
|
210
|
-
id:
|
|
217
|
+
id: "theme.openapi.securitySchemes.scopes",
|
|
211
218
|
message: "scopes:",
|
|
212
219
|
})
|
|
213
220
|
),
|
|
@@ -241,7 +248,7 @@ function SecuritySchemes(props) {
|
|
|
241
248
|
"strong",
|
|
242
249
|
null,
|
|
243
250
|
(0, Translate_1.translate)({
|
|
244
|
-
id:
|
|
251
|
+
id: "theme.openapi.securitySchemes.name",
|
|
245
252
|
message: "name:",
|
|
246
253
|
})
|
|
247
254
|
),
|
|
@@ -259,7 +266,7 @@ function SecuritySchemes(props) {
|
|
|
259
266
|
"strong",
|
|
260
267
|
null,
|
|
261
268
|
(0, Translate_1.translate)({
|
|
262
|
-
id:
|
|
269
|
+
id: "theme.openapi.securitySchemes.type",
|
|
263
270
|
message: "type:",
|
|
264
271
|
})
|
|
265
272
|
),
|
|
@@ -273,7 +280,7 @@ function SecuritySchemes(props) {
|
|
|
273
280
|
"strong",
|
|
274
281
|
null,
|
|
275
282
|
(0, Translate_1.translate)({
|
|
276
|
-
id:
|
|
283
|
+
id: "theme.openapi.securitySchemes.in",
|
|
277
284
|
message: "in:",
|
|
278
285
|
})
|
|
279
286
|
),
|
|
@@ -304,7 +311,7 @@ function SecuritySchemes(props) {
|
|
|
304
311
|
"strong",
|
|
305
312
|
null,
|
|
306
313
|
(0, Translate_1.translate)({
|
|
307
|
-
id:
|
|
314
|
+
id: "theme.openapi.securitySchemes.name",
|
|
308
315
|
message: "name:",
|
|
309
316
|
})
|
|
310
317
|
),
|
|
@@ -322,7 +329,7 @@ function SecuritySchemes(props) {
|
|
|
322
329
|
"strong",
|
|
323
330
|
null,
|
|
324
331
|
(0, Translate_1.translate)({
|
|
325
|
-
id:
|
|
332
|
+
id: "theme.openapi.securitySchemes.type",
|
|
326
333
|
message: "type:",
|
|
327
334
|
})
|
|
328
335
|
),
|
|
@@ -338,7 +345,7 @@ function SecuritySchemes(props) {
|
|
|
338
345
|
"strong",
|
|
339
346
|
null,
|
|
340
347
|
(0, Translate_1.translate)({
|
|
341
|
-
id:
|
|
348
|
+
id: "theme.openapi.securitySchemes.scopes",
|
|
342
349
|
message: "scopes:",
|
|
343
350
|
})
|
|
344
351
|
),
|
|
@@ -374,7 +381,7 @@ function SecuritySchemes(props) {
|
|
|
374
381
|
"strong",
|
|
375
382
|
null,
|
|
376
383
|
(0, Translate_1.translate)({
|
|
377
|
-
id:
|
|
384
|
+
id: "theme.openapi.securitySchemes.name",
|
|
378
385
|
message: "name:",
|
|
379
386
|
})
|
|
380
387
|
),
|
|
@@ -392,7 +399,7 @@ function SecuritySchemes(props) {
|
|
|
392
399
|
"strong",
|
|
393
400
|
null,
|
|
394
401
|
(0, Translate_1.translate)({
|
|
395
|
-
id:
|
|
402
|
+
id: "theme.openapi.securitySchemes.type",
|
|
396
403
|
message: "type:",
|
|
397
404
|
})
|
|
398
405
|
),
|
|
@@ -408,7 +415,7 @@ function SecuritySchemes(props) {
|
|
|
408
415
|
"strong",
|
|
409
416
|
null,
|
|
410
417
|
(0, Translate_1.translate)({
|
|
411
|
-
id:
|
|
418
|
+
id: "theme.openapi.securitySchemes.scopes",
|
|
412
419
|
message: "scopes:",
|
|
413
420
|
})
|
|
414
421
|
),
|
|
@@ -431,7 +438,7 @@ function SecuritySchemes(props) {
|
|
|
431
438
|
"strong",
|
|
432
439
|
null,
|
|
433
440
|
(0, Translate_1.translate)({
|
|
434
|
-
id:
|
|
441
|
+
id: "theme.openapi.securitySchemes.flows",
|
|
435
442
|
message: "flows:",
|
|
436
443
|
})
|
|
437
444
|
),
|
|
@@ -463,7 +470,7 @@ function SecuritySchemes(props) {
|
|
|
463
470
|
"strong",
|
|
464
471
|
null,
|
|
465
472
|
(0, Translate_1.translate)({
|
|
466
|
-
id:
|
|
473
|
+
id: "theme.openapi.securitySchemes.name",
|
|
467
474
|
message: "name:",
|
|
468
475
|
})
|
|
469
476
|
),
|
|
@@ -481,7 +488,7 @@ function SecuritySchemes(props) {
|
|
|
481
488
|
"strong",
|
|
482
489
|
null,
|
|
483
490
|
(0, Translate_1.translate)({
|
|
484
|
-
id:
|
|
491
|
+
id: "theme.openapi.securitySchemes.type",
|
|
485
492
|
message: "type:",
|
|
486
493
|
})
|
|
487
494
|
),
|
|
@@ -497,7 +504,7 @@ function SecuritySchemes(props) {
|
|
|
497
504
|
"strong",
|
|
498
505
|
null,
|
|
499
506
|
(0, Translate_1.translate)({
|
|
500
|
-
id:
|
|
507
|
+
id: "theme.openapi.securitySchemes.scopes",
|
|
501
508
|
message: "scopes:",
|
|
502
509
|
})
|
|
503
510
|
),
|
|
@@ -78,7 +78,6 @@ const FormTextInput_1 = __importDefault(
|
|
|
78
78
|
require("@theme/ApiExplorer/FormTextInput")
|
|
79
79
|
);
|
|
80
80
|
const hooks_1 = require("@theme/ApiItem/hooks");
|
|
81
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
82
81
|
const slice_1 = require("./slice");
|
|
83
82
|
function Server({ labelId }) {
|
|
84
83
|
const [isEditing, setIsEditing] = (0, react_1.useState)(false);
|
|
@@ -123,7 +122,7 @@ function Server({ labelId }) {
|
|
|
123
122
|
{
|
|
124
123
|
onClick: () => setIsEditing(true),
|
|
125
124
|
label: (0, Translate_1.translate)({
|
|
126
|
-
id:
|
|
125
|
+
id: "theme.openapi.server.editButton",
|
|
127
126
|
message: "Edit",
|
|
128
127
|
}),
|
|
129
128
|
},
|
|
@@ -146,7 +145,7 @@ function Server({ labelId }) {
|
|
|
146
145
|
{
|
|
147
146
|
onClick: () => setIsEditing(false),
|
|
148
147
|
label: (0, Translate_1.translate)({
|
|
149
|
-
id:
|
|
148
|
+
id: "theme.openapi.server.hideButton",
|
|
150
149
|
message: "Hide",
|
|
151
150
|
}),
|
|
152
151
|
},
|
|
@@ -73,7 +73,6 @@ const internal_1 = require("@docusaurus/theme-common/internal");
|
|
|
73
73
|
const Translate_1 = require("@docusaurus/Translate");
|
|
74
74
|
const useIsBrowser_1 = __importDefault(require("@docusaurus/useIsBrowser"));
|
|
75
75
|
const Heading_1 = __importDefault(require("@theme/Heading"));
|
|
76
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
77
76
|
const clsx_1 = __importDefault(require("clsx"));
|
|
78
77
|
function TabList({
|
|
79
78
|
className,
|
|
@@ -82,7 +81,7 @@ function TabList({
|
|
|
82
81
|
selectValue,
|
|
83
82
|
tabValues,
|
|
84
83
|
label = (0, Translate_1.translate)({
|
|
85
|
-
id:
|
|
84
|
+
id: "theme.openapi.tabs.responses.label",
|
|
86
85
|
message: "Responses",
|
|
87
86
|
}),
|
|
88
87
|
id = "responses",
|
|
@@ -17,7 +17,6 @@ const react_1 = __importDefault(require("react"));
|
|
|
17
17
|
const Translate_1 = require("@docusaurus/Translate");
|
|
18
18
|
const SchemaTabs_1 = __importDefault(require("@theme/SchemaTabs"));
|
|
19
19
|
const TabItem_1 = __importDefault(require("@theme/TabItem"));
|
|
20
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
21
20
|
const EXAMPLE_CLASS_NAME = "openapi-example";
|
|
22
21
|
const EXAMPLES_CLASS_NAME = "openapi-examples";
|
|
23
22
|
/**
|
|
@@ -53,7 +52,7 @@ const renderExample = (example) => {
|
|
|
53
52
|
"strong",
|
|
54
53
|
null,
|
|
55
54
|
(0, Translate_1.translate)({
|
|
56
|
-
id:
|
|
55
|
+
id: "theme.openapi.schemaItem.example",
|
|
57
56
|
message: "Example:",
|
|
58
57
|
}),
|
|
59
58
|
" "
|
|
@@ -114,7 +113,7 @@ const renderExamplesRecord = (examples) => {
|
|
|
114
113
|
"strong",
|
|
115
114
|
null,
|
|
116
115
|
(0, Translate_1.translate)({
|
|
117
|
-
id:
|
|
116
|
+
id: "theme.openapi.schemaItem.examples",
|
|
118
117
|
message: "Examples:",
|
|
119
118
|
})
|
|
120
119
|
),
|
|
@@ -151,7 +150,7 @@ const renderExampleObject = (exampleName, exampleProperties) => {
|
|
|
151
150
|
"strong",
|
|
152
151
|
null,
|
|
153
152
|
(0, Translate_1.translate)({
|
|
154
|
-
id:
|
|
153
|
+
id: "theme.openapi.schemaItem.description",
|
|
155
154
|
message: "Description:",
|
|
156
155
|
}),
|
|
157
156
|
" "
|
|
@@ -17,7 +17,6 @@ const Translate_1 = require("@docusaurus/Translate");
|
|
|
17
17
|
const Details_1 = __importDefault(require("@theme/Details"));
|
|
18
18
|
const ParamsItem_1 = __importDefault(require("@theme/ParamsItem"));
|
|
19
19
|
const SkeletonLoader_1 = __importDefault(require("@theme/SkeletonLoader"));
|
|
20
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
21
20
|
const ParamsDetailsComponent = ({ parameters }) => {
|
|
22
21
|
const types = ["path", "query", "header", "cookie"];
|
|
23
22
|
return react_1.default.createElement(
|
|
@@ -36,7 +35,7 @@ const ParamsDetailsComponent = ({ parameters }) => {
|
|
|
36
35
|
{ className: "openapi-markdown__details-summary-header-params" },
|
|
37
36
|
(0, Translate_1.translate)(
|
|
38
37
|
{
|
|
39
|
-
id:
|
|
38
|
+
id: "theme.openapi.paramsDetails.parametersTitle",
|
|
40
39
|
message: "{type} Parameters",
|
|
41
40
|
},
|
|
42
41
|
{ type: type.charAt(0).toUpperCase() + type.slice(1) }
|
|
@@ -16,18 +16,17 @@ const Translate_1 = require("@docusaurus/Translate");
|
|
|
16
16
|
const Example_1 = require("@theme/Example");
|
|
17
17
|
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
18
18
|
/* eslint-disable import/no-extraneous-dependencies*/
|
|
19
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
20
19
|
const clsx_1 = __importDefault(require("clsx"));
|
|
21
20
|
const schema_1 = require("../../markdown/schema");
|
|
22
21
|
const utils_1 = require("../../markdown/utils");
|
|
23
22
|
const getEnumDescriptionMarkdown = (enumDescriptions) => {
|
|
24
23
|
if (enumDescriptions?.length) {
|
|
25
24
|
const enumValue = (0, Translate_1.translate)({
|
|
26
|
-
id:
|
|
25
|
+
id: "theme.openapi.schemaItem.enumValue",
|
|
27
26
|
message: "Enum Value",
|
|
28
27
|
});
|
|
29
28
|
const description = (0, Translate_1.translate)({
|
|
30
|
-
id:
|
|
29
|
+
id: "theme.openapi.schemaItem.enumDescription",
|
|
31
30
|
message: "Description",
|
|
32
31
|
});
|
|
33
32
|
return `| ${enumValue} | ${description} |
|
|
@@ -73,7 +72,7 @@ function ParamsItem({ param, ...rest }) {
|
|
|
73
72
|
"span",
|
|
74
73
|
{ className: "openapi-schema__required" },
|
|
75
74
|
(0, Translate_1.translate)({
|
|
76
|
-
id:
|
|
75
|
+
id: "theme.openapi.schemaItem.required",
|
|
77
76
|
message: "required",
|
|
78
77
|
})
|
|
79
78
|
)
|
|
@@ -83,7 +82,7 @@ function ParamsItem({ param, ...rest }) {
|
|
|
83
82
|
"span",
|
|
84
83
|
{ className: "openapi-schema__deprecated" },
|
|
85
84
|
(0, Translate_1.translate)({
|
|
86
|
-
id:
|
|
85
|
+
id: "theme.openapi.schemaItem.deprecated",
|
|
87
86
|
message: "deprecated",
|
|
88
87
|
})
|
|
89
88
|
)
|
|
@@ -99,7 +98,7 @@ function ParamsItem({ param, ...rest }) {
|
|
|
99
98
|
return undefined;
|
|
100
99
|
}
|
|
101
100
|
const label = (0, Translate_1.translate)({
|
|
102
|
-
id:
|
|
101
|
+
id: "theme.openapi.schemaItem.constantValue",
|
|
103
102
|
message: "Constant value:",
|
|
104
103
|
});
|
|
105
104
|
return react_1.default.createElement(
|
|
@@ -142,7 +141,7 @@ function ParamsItem({ param, ...rest }) {
|
|
|
142
141
|
"strong",
|
|
143
142
|
null,
|
|
144
143
|
(0, Translate_1.translate)({
|
|
145
|
-
id:
|
|
144
|
+
id: "theme.openapi.schemaItem.defaultValue",
|
|
146
145
|
message: "Default value:",
|
|
147
146
|
}),
|
|
148
147
|
" "
|
|
@@ -161,7 +160,7 @@ function ParamsItem({ param, ...rest }) {
|
|
|
161
160
|
"strong",
|
|
162
161
|
null,
|
|
163
162
|
(0, Translate_1.translate)({
|
|
164
|
-
id:
|
|
163
|
+
id: "theme.openapi.schemaItem.defaultValue",
|
|
165
164
|
message: "Default value:",
|
|
166
165
|
}),
|
|
167
166
|
" "
|
|
@@ -23,7 +23,6 @@ const SchemaExpansion_1 = __importDefault(require("@theme/SchemaExpansion"));
|
|
|
23
23
|
const SchemaTabs_1 = __importDefault(require("@theme/SchemaTabs"));
|
|
24
24
|
const SkeletonLoader_1 = __importDefault(require("@theme/SkeletonLoader"));
|
|
25
25
|
const TabItem_1 = __importDefault(require("@theme/TabItem"));
|
|
26
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
27
26
|
const RequestSchemaComponent = ({ title, body, style }) => {
|
|
28
27
|
if (
|
|
29
28
|
body === undefined ||
|
|
@@ -84,7 +83,7 @@ const RequestSchemaComponent = ({ title, body, style }) => {
|
|
|
84
83
|
"openapi-markdown__details-summary-header-body",
|
|
85
84
|
},
|
|
86
85
|
(0, Translate_1.translate)({
|
|
87
|
-
id:
|
|
86
|
+
id: "theme.openapi.request.body.title",
|
|
88
87
|
message: title,
|
|
89
88
|
}),
|
|
90
89
|
body.required === true &&
|
|
@@ -92,8 +91,7 @@ const RequestSchemaComponent = ({ title, body, style }) => {
|
|
|
92
91
|
"span",
|
|
93
92
|
{ className: "openapi-schema__required" },
|
|
94
93
|
(0, Translate_1.translate)({
|
|
95
|
-
id:
|
|
96
|
-
.REQUIRED,
|
|
94
|
+
id: "theme.openapi.schemaItem.required",
|
|
97
95
|
message: "required",
|
|
98
96
|
})
|
|
99
97
|
)
|
|
@@ -193,7 +191,7 @@ const RequestSchemaComponent = ({ title, body, style }) => {
|
|
|
193
191
|
className: "openapi-markdown__details-summary-header-body",
|
|
194
192
|
},
|
|
195
193
|
(0, Translate_1.translate)({
|
|
196
|
-
id:
|
|
194
|
+
id: "theme.openapi.request.body.title",
|
|
197
195
|
message: title,
|
|
198
196
|
}),
|
|
199
197
|
firstBody.type === "array" &&
|
|
@@ -207,7 +205,7 @@ const RequestSchemaComponent = ({ title, body, style }) => {
|
|
|
207
205
|
"strong",
|
|
208
206
|
{ className: "openapi-schema__required" },
|
|
209
207
|
(0, Translate_1.translate)({
|
|
210
|
-
id:
|
|
208
|
+
id: "theme.openapi.schemaItem.required",
|
|
211
209
|
message: "required",
|
|
212
210
|
})
|
|
213
211
|
)
|
|
@@ -21,7 +21,6 @@ const Translate_1 = require("@docusaurus/Translate");
|
|
|
21
21
|
const CodeSamples_1 = __importDefault(require("@theme/CodeSamples"));
|
|
22
22
|
const Markdown_1 = __importDefault(require("@theme/Markdown"));
|
|
23
23
|
const TabItem_1 = __importDefault(require("@theme/TabItem"));
|
|
24
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
25
24
|
const createResponseExample_1 = require("docusaurus-plugin-openapi-docs/lib/openapi/createResponseExample");
|
|
26
25
|
const xml_formatter_1 = __importDefault(require("xml-formatter"));
|
|
27
26
|
function json2xml(o, tab) {
|
|
@@ -111,7 +110,7 @@ const ResponseExample = ({ responseExample, mimeType }) => {
|
|
|
111
110
|
TabItem_1.default,
|
|
112
111
|
{
|
|
113
112
|
label: (0, Translate_1.translate)({
|
|
114
|
-
id:
|
|
113
|
+
id: "theme.openapi.responseExamples.example",
|
|
115
114
|
message: "Example",
|
|
116
115
|
}),
|
|
117
116
|
value: "Example",
|
|
@@ -173,7 +172,7 @@ const ExampleFromSchema = ({ schema, mimeType }) => {
|
|
|
173
172
|
TabItem_1.default,
|
|
174
173
|
{
|
|
175
174
|
label: (0, Translate_1.translate)({
|
|
176
|
-
id:
|
|
175
|
+
id: "theme.openapi.responseExamples.autoExample",
|
|
177
176
|
message: "Example (auto)",
|
|
178
177
|
}),
|
|
179
178
|
value: "Example (auto)",
|
|
@@ -196,7 +195,7 @@ const ExampleFromSchema = ({ schema, mimeType }) => {
|
|
|
196
195
|
TabItem_1.default,
|
|
197
196
|
{
|
|
198
197
|
label: (0, Translate_1.translate)({
|
|
199
|
-
id:
|
|
198
|
+
id: "theme.openapi.responseExamples.autoExample",
|
|
200
199
|
message: "Example (auto)",
|
|
201
200
|
}),
|
|
202
201
|
value: "Example (auto)",
|
|
@@ -23,7 +23,6 @@ const SchemaExpansion_1 = __importDefault(require("@theme/SchemaExpansion"));
|
|
|
23
23
|
const SchemaTabs_1 = __importDefault(require("@theme/SchemaTabs"));
|
|
24
24
|
const SkeletonLoader_1 = __importDefault(require("@theme/SkeletonLoader"));
|
|
25
25
|
const TabItem_1 = __importDefault(require("@theme/TabItem"));
|
|
26
|
-
const translationIds_1 = require("@theme/translationIds");
|
|
27
26
|
const ResponseSchemaComponent = ({ title, body, style }) => {
|
|
28
27
|
if (
|
|
29
28
|
body === undefined ||
|
|
@@ -58,7 +57,7 @@ const ResponseSchemaComponent = ({ title, body, style }) => {
|
|
|
58
57
|
"div",
|
|
59
58
|
null,
|
|
60
59
|
(0, Translate_1.translate)({
|
|
61
|
-
id:
|
|
60
|
+
id: "theme.openapi.schema.noSchema",
|
|
62
61
|
message: "No schema",
|
|
63
62
|
})
|
|
64
63
|
)
|
|
@@ -101,7 +100,7 @@ const ResponseSchemaComponent = ({ title, body, style }) => {
|
|
|
101
100
|
"span",
|
|
102
101
|
{ className: "openapi-schema__required" },
|
|
103
102
|
(0, Translate_1.translate)({
|
|
104
|
-
id:
|
|
103
|
+
id: "theme.openapi.schemaItem.required",
|
|
105
104
|
message: "required",
|
|
106
105
|
})
|
|
107
106
|
)
|