docusaurus-plugin-openapi-docs 0.0.0-459 → 0.0.0-461
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
CHANGED
|
@@ -109,6 +109,7 @@ function pluginOpenAPIDocs(context, options) {
|
|
|
109
109
|
? fs_1.default.readFileSync(template).toString()
|
|
110
110
|
: `---
|
|
111
111
|
id: {{{id}}}
|
|
112
|
+
title: "{{{title}}}"
|
|
112
113
|
description: "{{{description}}}"
|
|
113
114
|
{{^api}}
|
|
114
115
|
sidebar_label: Introduction
|
|
@@ -138,6 +139,8 @@ info_path: {{{infoPath}}}
|
|
|
138
139
|
`;
|
|
139
140
|
const infoMdTemplate = `---
|
|
140
141
|
id: {{{id}}}
|
|
142
|
+
title: "{{{title}}}"
|
|
143
|
+
description: "{{{description}}}"
|
|
141
144
|
sidebar_label: {{{title}}}
|
|
142
145
|
hide_title: true
|
|
143
146
|
custom_edit_url: null
|
|
@@ -154,7 +157,7 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
|
|
|
154
157
|
`;
|
|
155
158
|
const tagMdTemplate = `---
|
|
156
159
|
id: {{{id}}}
|
|
157
|
-
title: {{{description}}}
|
|
160
|
+
title: "{{{description}}}"
|
|
158
161
|
description: "{{{description}}}"
|
|
159
162
|
custom_edit_url: null
|
|
160
163
|
---
|
|
@@ -28,12 +28,15 @@ function serializer(replacer, cycleReplacer) {
|
|
|
28
28
|
// Resolve discriminator ref pointers
|
|
29
29
|
if ((value === null || value === void 0 ? void 0 : value.discriminator) !== undefined) {
|
|
30
30
|
const parser = new OpenAPIParser_1.OpenAPIParser(stack[0]);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
if (value.discriminator.mapping &&
|
|
32
|
+
typeof value.discriminator.mapping === "object") {
|
|
33
|
+
for (let [k, v] of Object.entries(value.discriminator.mapping)) {
|
|
34
|
+
const discriminator = k;
|
|
35
|
+
if (typeof v === "string" && v.charAt(0) === "#") {
|
|
36
|
+
const ref = v;
|
|
37
|
+
const resolvedRef = parser.byRef(ref);
|
|
38
|
+
value.discriminator.mapping[discriminator] = resolvedRef;
|
|
39
|
+
}
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
42
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "docusaurus-plugin-openapi-docs",
|
|
3
3
|
"description": "OpenAPI plugin for Docusaurus.",
|
|
4
|
-
"version": "0.0.0-
|
|
4
|
+
"version": "0.0.0-461",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"openapi",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"engines": {
|
|
69
69
|
"node": ">=14"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "8f104d54cad7b699a85a34d392f44da232e76c98"
|
|
72
72
|
}
|
package/src/index.ts
CHANGED
|
@@ -143,6 +143,7 @@ export default function pluginOpenAPIDocs(
|
|
|
143
143
|
? fs.readFileSync(template).toString()
|
|
144
144
|
: `---
|
|
145
145
|
id: {{{id}}}
|
|
146
|
+
title: "{{{title}}}"
|
|
146
147
|
description: "{{{description}}}"
|
|
147
148
|
{{^api}}
|
|
148
149
|
sidebar_label: Introduction
|
|
@@ -173,6 +174,8 @@ info_path: {{{infoPath}}}
|
|
|
173
174
|
|
|
174
175
|
const infoMdTemplate = `---
|
|
175
176
|
id: {{{id}}}
|
|
177
|
+
title: "{{{title}}}"
|
|
178
|
+
description: "{{{description}}}"
|
|
176
179
|
sidebar_label: {{{title}}}
|
|
177
180
|
hide_title: true
|
|
178
181
|
custom_edit_url: null
|
|
@@ -190,7 +193,7 @@ import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
|
|
|
190
193
|
|
|
191
194
|
const tagMdTemplate = `---
|
|
192
195
|
id: {{{id}}}
|
|
193
|
-
title: {{{description}}}
|
|
196
|
+
title: "{{{description}}}"
|
|
194
197
|
description: "{{{description}}}"
|
|
195
198
|
custom_edit_url: null
|
|
196
199
|
---
|
|
@@ -30,12 +30,17 @@ function serializer(replacer: any, cycleReplacer: any) {
|
|
|
30
30
|
// Resolve discriminator ref pointers
|
|
31
31
|
if (value?.discriminator !== undefined) {
|
|
32
32
|
const parser = new OpenAPIParser(stack[0]);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
if (
|
|
34
|
+
value.discriminator.mapping &&
|
|
35
|
+
typeof value.discriminator.mapping === "object"
|
|
36
|
+
) {
|
|
37
|
+
for (let [k, v] of Object.entries(value.discriminator.mapping)) {
|
|
38
|
+
const discriminator = k as string;
|
|
39
|
+
if (typeof v === "string" && v.charAt(0) === "#") {
|
|
40
|
+
const ref = v as string;
|
|
41
|
+
const resolvedRef = parser.byRef(ref);
|
|
42
|
+
value.discriminator.mapping[discriminator] = resolvedRef;
|
|
43
|
+
}
|
|
39
44
|
}
|
|
40
45
|
}
|
|
41
46
|
}
|