@1szx1/vite-plugin-swagger2ts 1.1.2 → 1.1.4
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/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -122,7 +122,7 @@ param:{${paramString}}` : ""}${responseString}}` });
|
|
|
122
122
|
return generatorSchemaType(getRefName(`#/components/schemas/${name}`, docsName), schema, { isRoot: true, isExport: true, docsName });
|
|
123
123
|
}).join("") : "";
|
|
124
124
|
const apiString = `${typeString}
|
|
125
|
-
export interface ${getPathsName(docsName)}
|
|
125
|
+
export interface ${getPathsName(docsName)}{${pathsTypeString}}
|
|
126
126
|
`;
|
|
127
127
|
return apiString.replaceAll(/\n\n/g, "\n").replaceAll(/\n\n/g, "\n");
|
|
128
128
|
}
|
|
@@ -250,7 +250,7 @@ function swagger2TsPlugin(userOptions) {
|
|
|
250
250
|
const code = (await Promise.all(sources.map(genCode))).reduce((a, b, index, list) => {
|
|
251
251
|
let res = a + b;
|
|
252
252
|
if (index === list.length - 1) {
|
|
253
|
-
const suffix = `export type ${getPathsName("
|
|
253
|
+
const suffix = `export type ${getPathsName("_Intersection")} = ${sources.map(({ name }) => getPathsName(name)).join("&")}
|
|
254
254
|
`;
|
|
255
255
|
res += suffix;
|
|
256
256
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -114,7 +114,7 @@ param:{${paramString}}` : ""}${responseString}}` });
|
|
|
114
114
|
return generatorSchemaType(getRefName(`#/components/schemas/${name}`, docsName), schema, { isRoot: true, isExport: true, docsName });
|
|
115
115
|
}).join("") : "";
|
|
116
116
|
const apiString = `${typeString}
|
|
117
|
-
export interface ${getPathsName(docsName)}
|
|
117
|
+
export interface ${getPathsName(docsName)}{${pathsTypeString}}
|
|
118
118
|
`;
|
|
119
119
|
return apiString.replaceAll(/\n\n/g, "\n").replaceAll(/\n\n/g, "\n");
|
|
120
120
|
}
|
|
@@ -242,7 +242,7 @@ function swagger2TsPlugin(userOptions) {
|
|
|
242
242
|
const code = (await Promise.all(sources.map(genCode))).reduce((a, b, index, list) => {
|
|
243
243
|
let res = a + b;
|
|
244
244
|
if (index === list.length - 1) {
|
|
245
|
-
const suffix = `export type ${getPathsName("
|
|
245
|
+
const suffix = `export type ${getPathsName("_Intersection")} = ${sources.map(({ name }) => getPathsName(name)).join("&")}
|
|
246
246
|
`;
|
|
247
247
|
res += suffix;
|
|
248
248
|
}
|
package/package.json
CHANGED