@1szx1/vite-plugin-swagger2ts 1.3.13 → 1.3.14
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
|
@@ -124,7 +124,7 @@ function generateDocs(input, { docsName, baseUrl, formatSchema }) {
|
|
|
124
124
|
return jsDoc({}, { key: method, result: `{${paramString ? `
|
|
125
125
|
param:{${paramString}}` : ""}${responseString}}` });
|
|
126
126
|
}).join("");
|
|
127
|
-
return jsDoc({}, { key:
|
|
127
|
+
return jsDoc({}, { key: `${baseUrl}${endPoint}`, result: `{${result}}` });
|
|
128
128
|
}).join("");
|
|
129
129
|
const typeString = input.components?.schemas ? Object.entries(input.components.schemas).map(([name, schema]) => {
|
|
130
130
|
if (typeof formatSchema == "function") {
|
|
@@ -208,7 +208,7 @@ function generatorResponseBodyType(schemas, docsName) {
|
|
|
208
208
|
return jsDoc({ description }, { key: "response", result });
|
|
209
209
|
}
|
|
210
210
|
function jsDoc({ description, title, format, example, default: default1 }, { key, result, isRoot, isExport, isRequired }) {
|
|
211
|
-
if (
|
|
211
|
+
if (!(isRoot || isExport) && !/^[^'"]*$/.test(key))
|
|
212
212
|
key = `'${key}'`;
|
|
213
213
|
const jsDoc2 = `
|
|
214
214
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -115,7 +115,7 @@ function generateDocs(input, { docsName, baseUrl, formatSchema }) {
|
|
|
115
115
|
return jsDoc({}, { key: method, result: `{${paramString ? `
|
|
116
116
|
param:{${paramString}}` : ""}${responseString}}` });
|
|
117
117
|
}).join("");
|
|
118
|
-
return jsDoc({}, { key:
|
|
118
|
+
return jsDoc({}, { key: `${baseUrl}${endPoint}`, result: `{${result}}` });
|
|
119
119
|
}).join("");
|
|
120
120
|
const typeString = input.components?.schemas ? Object.entries(input.components.schemas).map(([name, schema]) => {
|
|
121
121
|
if (typeof formatSchema == "function") {
|
|
@@ -199,7 +199,7 @@ function generatorResponseBodyType(schemas, docsName) {
|
|
|
199
199
|
return jsDoc({ description }, { key: "response", result });
|
|
200
200
|
}
|
|
201
201
|
function jsDoc({ description, title, format, example, default: default1 }, { key, result, isRoot, isExport, isRequired }) {
|
|
202
|
-
if (
|
|
202
|
+
if (!(isRoot || isExport) && !/^[^'"]*$/.test(key))
|
|
203
203
|
key = `'${key}'`;
|
|
204
204
|
const jsDoc2 = `
|
|
205
205
|
/**
|
package/package.json
CHANGED