openapi-ts-request 0.3.1 → 0.3.2
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/dist/generator/util.js +3 -3
- package/package.json +1 -1
package/dist/generator/util.js
CHANGED
|
@@ -275,14 +275,14 @@ function resolveFunctionName(functionName, methodName) {
|
|
|
275
275
|
exports.resolveFunctionName = resolveFunctionName;
|
|
276
276
|
// 标记引用的 $ref 对应的schema
|
|
277
277
|
function markAllowSchema(schemaStr, schemas) {
|
|
278
|
-
const refs = schemaStr.match(/#\/components\/schemas\/([A-Za-z0-9._-]+)/g);
|
|
278
|
+
const refs = schemaStr === null || schemaStr === void 0 ? void 0 : schemaStr.match(/#\/components\/schemas\/([A-Za-z0-9._-]+)/g);
|
|
279
279
|
(0, lodash_1.forEach)(refs, (ref) => {
|
|
280
280
|
const refPaths = ref.split('/');
|
|
281
281
|
const schema = schemas === null || schemas === void 0 ? void 0 : schemas[refPaths[refPaths.length - 1]];
|
|
282
|
-
if (schema) {
|
|
282
|
+
if (!(schema === null || schema === void 0 ? void 0 : schema.isAllowed)) {
|
|
283
283
|
schema.isAllowed = true;
|
|
284
|
+
markAllowSchema(JSON.stringify(schema), schemas);
|
|
284
285
|
}
|
|
285
|
-
markAllowSchema(JSON.stringify(schema), schemas);
|
|
286
286
|
});
|
|
287
287
|
}
|
|
288
288
|
exports.markAllowSchema = markAllowSchema;
|
package/package.json
CHANGED