swagger-to-axios 1.0.10 → 1.0.11
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/lib/index.js +0 -4
- package/lib/utils/index.js +1 -1
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -27,10 +27,6 @@ const createApiFiles = async (swaggerList = [], config = {}) => {
|
|
|
27
27
|
}
|
|
28
28
|
if (improtAxiosPath) {
|
|
29
29
|
fileContent += `import request from '${improtAxiosPath}';
|
|
30
|
-
`;
|
|
31
|
-
}
|
|
32
|
-
if (typeScript) {
|
|
33
|
-
fileContent += `import "./typings";
|
|
34
30
|
`;
|
|
35
31
|
}
|
|
36
32
|
fileContent += `
|
package/lib/utils/index.js
CHANGED
|
@@ -187,7 +187,7 @@ export const openapiTypeToTypeScript = (schemaObject) => {
|
|
|
187
187
|
* 在后面进行格式化的时候会将正确的字符串转换为正常形式,
|
|
188
188
|
* 错误的继续保留字符串。
|
|
189
189
|
* */
|
|
190
|
-
return `'${key}'
|
|
190
|
+
return `'${key}': ${openapiTypeToTypeScript(schemaObject?.properties &&
|
|
191
191
|
schemaObject?.properties?.[key])}; `;
|
|
192
192
|
})
|
|
193
193
|
.join('')}}`;
|