@goast/core 0.5.2 → 0.5.3
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/esm/src/parse/parser.js
CHANGED
|
@@ -92,6 +92,7 @@ export class OpenApiParser {
|
|
|
92
92
|
return result;
|
|
93
93
|
}
|
|
94
94
|
async resolveReference(file, ref) {
|
|
95
|
+
var _a;
|
|
95
96
|
const [refFile, refPath] = ref.$ref.split('#');
|
|
96
97
|
let absoluteRefFile = refFile;
|
|
97
98
|
if (!/\S/.test(refFile)) {
|
|
@@ -103,7 +104,7 @@ export class OpenApiParser {
|
|
|
103
104
|
const doc = await this.loadDocument(absoluteRefFile);
|
|
104
105
|
const value = refPath ? getDeepProperty(doc.document, refPath.replace(/[/]/g, '.')) : doc.document;
|
|
105
106
|
if (value && typeof value === 'object') {
|
|
106
|
-
return this.dereference(absoluteRefFile, refPath.split('/').filter(Boolean), value);
|
|
107
|
+
return this.dereference(absoluteRefFile, (_a = refPath === null || refPath === void 0 ? void 0 : refPath.split('/').filter(Boolean)) !== null && _a !== void 0 ? _a : [], value);
|
|
107
108
|
}
|
|
108
109
|
return undefined;
|
|
109
110
|
}
|
package/package.json
CHANGED
|
@@ -96,6 +96,7 @@ class OpenApiParser {
|
|
|
96
96
|
return result;
|
|
97
97
|
}
|
|
98
98
|
async resolveReference(file, ref) {
|
|
99
|
+
var _a;
|
|
99
100
|
const [refFile, refPath] = ref.$ref.split('#');
|
|
100
101
|
let absoluteRefFile = refFile;
|
|
101
102
|
if (!/\S/.test(refFile)) {
|
|
@@ -107,7 +108,7 @@ class OpenApiParser {
|
|
|
107
108
|
const doc = await this.loadDocument(absoluteRefFile);
|
|
108
109
|
const value = refPath ? getDeepProperty(doc.document, refPath.replace(/[/]/g, '.')) : doc.document;
|
|
109
110
|
if (value && typeof value === 'object') {
|
|
110
|
-
return this.dereference(absoluteRefFile, refPath.split('/').filter(Boolean), value);
|
|
111
|
+
return this.dereference(absoluteRefFile, (_a = refPath === null || refPath === void 0 ? void 0 : refPath.split('/').filter(Boolean)) !== null && _a !== void 0 ? _a : [], value);
|
|
111
112
|
}
|
|
112
113
|
return undefined;
|
|
113
114
|
}
|
package/src/src/parse/parser.ts
CHANGED
|
@@ -127,7 +127,7 @@ export class OpenApiParser {
|
|
|
127
127
|
|
|
128
128
|
const value = refPath ? getDeepProperty(doc.document, refPath.replace(/[/]/g, '.')) : doc.document;
|
|
129
129
|
if (value && typeof value === 'object') {
|
|
130
|
-
return this.dereference(absoluteRefFile, refPath
|
|
130
|
+
return this.dereference(absoluteRefFile, refPath?.split('/').filter(Boolean) ?? [], value as T);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
return undefined;
|