yapi-apifox-to-typescript 5.0.1 → 5.0.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.
@@ -47,12 +47,17 @@ var SwaggerToYApiServer = class {
47
47
  }));
48
48
  this.swaggerJson = docs.reduce((acc, doc, i) => {
49
49
  if (i === 0) return { ...doc };
50
+ const accTags = Array.isArray(acc.tags) ? acc.tags : [];
51
+ const docTags = Array.isArray(doc.tags) ? doc.tags : [];
52
+ const seen = new Set(accTags.map((t) => t?.name));
53
+ const mergedTags = [...accTags, ...docTags.filter((t) => t?.name && !seen.has(t.name))];
50
54
  return {
51
55
  ...acc,
52
56
  paths: {
53
57
  ...acc.paths,
54
58
  ...doc.paths
55
59
  },
60
+ tags: mergedTags,
56
61
  components: {
57
62
  ...acc.components,
58
63
  schemas: {
@@ -41,12 +41,17 @@ var SwaggerToYApiServer = class {
41
41
  }));
42
42
  this.swaggerJson = docs.reduce((acc, doc, i) => {
43
43
  if (i === 0) return { ...doc };
44
+ const accTags = Array.isArray(acc.tags) ? acc.tags : [];
45
+ const docTags = Array.isArray(doc.tags) ? doc.tags : [];
46
+ const seen = new Set(accTags.map((t) => t?.name));
47
+ const mergedTags = [...accTags, ...docTags.filter((t) => t?.name && !seen.has(t.name))];
44
48
  return {
45
49
  ...acc,
46
50
  paths: {
47
51
  ...acc.paths,
48
52
  ...doc.paths
49
53
  },
54
+ tags: mergedTags,
50
55
  components: {
51
56
  ...acc.components,
52
57
  schemas: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yapi-apifox-to-typescript",
3
- "version": "5.0.1",
3
+ "version": "5.0.2",
4
4
  "description": "根据 YApi 或 Apifox 的接口定义生成 TypeScript/JavaScript 的接口类型及其请求函数代码。",
5
5
  "keywords": [
6
6
  "yapi",