docusaurus-theme-openapi-docs 0.0.0-418 → 0.0.0-419
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/utils.js
CHANGED
|
@@ -23,9 +23,10 @@ function SchemaItem({
|
|
|
23
23
|
schemaName,
|
|
24
24
|
defaultValue,
|
|
25
25
|
}) {
|
|
26
|
-
const renderRequired = guard(
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const renderRequired = guard(
|
|
27
|
+
Array.isArray(required) ? required.includes(name) : required,
|
|
28
|
+
() => <strong className={styles.required}> required</strong>
|
|
29
|
+
);
|
|
29
30
|
|
|
30
31
|
const renderSchemaDescription = guard(schemaDescription, (description) => (
|
|
31
32
|
<div className={styles.schemaDescription}>
|
|
@@ -39,11 +40,14 @@ function SchemaItem({
|
|
|
39
40
|
</div>
|
|
40
41
|
));
|
|
41
42
|
|
|
42
|
-
const renderDefaultValue = guard(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
const renderDefaultValue = guard(
|
|
44
|
+
typeof defaultValue === "boolean" ? defaultValue.toString() : defaultValue,
|
|
45
|
+
(value) => (
|
|
46
|
+
<div className={styles.schemaQualifierMessage}>
|
|
47
|
+
<ReactMarkdown children={`**Default value:** \`${value}\``} />
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
);
|
|
47
51
|
|
|
48
52
|
const schemaContent = (
|
|
49
53
|
<div>
|
|
@@ -15,10 +15,6 @@ export function create(tag, props) {
|
|
|
15
15
|
return `<${tag}${propString}>${render(children)}</${tag}>`;
|
|
16
16
|
}
|
|
17
17
|
export function guard(value, cb) {
|
|
18
|
-
if (typeof value === "boolean") {
|
|
19
|
-
value = value.toString();
|
|
20
|
-
}
|
|
21
|
-
|
|
22
18
|
if (value) {
|
|
23
19
|
const children = cb(value);
|
|
24
20
|
return render(children);
|
|
@@ -23,9 +23,10 @@ function SchemaItem({
|
|
|
23
23
|
schemaName,
|
|
24
24
|
defaultValue,
|
|
25
25
|
}) {
|
|
26
|
-
const renderRequired = guard(
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const renderRequired = guard(
|
|
27
|
+
Array.isArray(required) ? required.includes(name) : required,
|
|
28
|
+
() => <strong className={styles.required}> required</strong>
|
|
29
|
+
);
|
|
29
30
|
|
|
30
31
|
const renderSchemaDescription = guard(schemaDescription, (description) => (
|
|
31
32
|
<div className={styles.schemaDescription}>
|
|
@@ -39,11 +40,14 @@ function SchemaItem({
|
|
|
39
40
|
</div>
|
|
40
41
|
));
|
|
41
42
|
|
|
42
|
-
const renderDefaultValue = guard(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
const renderDefaultValue = guard(
|
|
44
|
+
typeof defaultValue === "boolean" ? defaultValue.toString() : defaultValue,
|
|
45
|
+
(value) => (
|
|
46
|
+
<div className={styles.schemaQualifierMessage}>
|
|
47
|
+
<ReactMarkdown children={`**Default value:** \`${value}\``} />
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
);
|
|
47
51
|
|
|
48
52
|
const schemaContent = (
|
|
49
53
|
<div>
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-theme-openapi-docs",
|
|
3
3
|
"description": "OpenAPI theme for Docusaurus.",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-419",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"buffer": "^6.0.3",
|
|
51
51
|
"clsx": "^1.1.1",
|
|
52
52
|
"crypto-js": "^4.1.1",
|
|
53
|
-
"docusaurus-plugin-openapi-docs": "0.0.0-
|
|
53
|
+
"docusaurus-plugin-openapi-docs": "0.0.0-419",
|
|
54
54
|
"immer": "^9.0.7",
|
|
55
55
|
"lodash": "^4.17.20",
|
|
56
56
|
"process": "^0.11.10",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">=14"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "c5df2d9c69e2d3881b329ba3586cbc3853ba553b"
|
|
72
72
|
}
|
package/src/markdown/utils.ts
CHANGED
|
@@ -23,9 +23,10 @@ function SchemaItem({
|
|
|
23
23
|
schemaName,
|
|
24
24
|
defaultValue,
|
|
25
25
|
}) {
|
|
26
|
-
const renderRequired = guard(
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
const renderRequired = guard(
|
|
27
|
+
Array.isArray(required) ? required.includes(name) : required,
|
|
28
|
+
() => <strong className={styles.required}> required</strong>
|
|
29
|
+
);
|
|
29
30
|
|
|
30
31
|
const renderSchemaDescription = guard(schemaDescription, (description) => (
|
|
31
32
|
<div className={styles.schemaDescription}>
|
|
@@ -39,11 +40,14 @@ function SchemaItem({
|
|
|
39
40
|
</div>
|
|
40
41
|
));
|
|
41
42
|
|
|
42
|
-
const renderDefaultValue = guard(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
const renderDefaultValue = guard(
|
|
44
|
+
typeof defaultValue === "boolean" ? defaultValue.toString() : defaultValue,
|
|
45
|
+
(value) => (
|
|
46
|
+
<div className={styles.schemaQualifierMessage}>
|
|
47
|
+
<ReactMarkdown children={`**Default value:** \`${value}\``} />
|
|
48
|
+
</div>
|
|
49
|
+
)
|
|
50
|
+
);
|
|
47
51
|
|
|
48
52
|
const schemaContent = (
|
|
49
53
|
<div>
|