docusaurus-plugin-openapi-docs 0.0.0-459 → 0.0.0-460
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.
|
@@ -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-460",
|
|
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": "a17b4695235a05558c0d589c3512e28a86a3ce75"
|
|
72
72
|
}
|
|
@@ -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
|
}
|