openapi-ts-request 0.3.1 → 0.3.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.
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openapi-ts-request",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Swagger2/OpenAPI3 to TypeScript, request client, request mock service, enum, type field label, JSON Schemas",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,6 +20,7 @@
20
20
  ],
21
21
  "dependencies": {
22
22
  "@prettier/sync": "^0.5.2",
23
+ "@trivago/prettier-plugin-sort-imports": "^4.3.0",
23
24
  "axios": "^1.7.2",
24
25
  "chalk": "^4.1.2",
25
26
  "cosmiconfig": "^9.0.0",
@@ -40,7 +41,6 @@
40
41
  "@changesets/cli": "^2.27.6",
41
42
  "@commitlint/cli": "^19.2.1",
42
43
  "@commitlint/config-conventional": "^19.2.2",
43
- "@trivago/prettier-plugin-sort-imports": "^4.3.0",
44
44
  "@types/lodash": "^4.17.5",
45
45
  "@types/memoizee": "^0.4.11",
46
46
  "@types/mockjs": "^1.0.10",