swagger-axios-codegen
Advanced tools
Comparing version 0.10.4 to 0.10.5
### 0.10.4 | ||
### 0.10.5 | ||
@@ -4,0 +4,0 @@ - feat: anyOf, allOf (#96) |
@@ -22,24 +22,31 @@ "use strict"; | ||
else if (v.items) { | ||
if (v.type === "array" && v.items.oneOf && v.items.oneOf.length > 0) { | ||
result.isUnionType = true; | ||
result.propType = v.items.oneOf.map((type) => { | ||
return utils_1.refClassName(type.$ref); | ||
}).join(','); | ||
if (v.items.$ref) { | ||
// 是个引用类型 | ||
result.ref = utils_1.refClassName(v.items.$ref); | ||
result.propType = result.ref + '[]'; | ||
} | ||
else if (v.type === "array" && v.items.allOf && v.items.allOf.length > 0) { | ||
result.isCombinedType = true; | ||
result.propType = v.items.allOf.map((type) => { | ||
return utils_1.refClassName(type.$ref); | ||
}).join(','); | ||
} | ||
else if (v.items.type === "array") { | ||
const currentResult = propTrueType(v.items); | ||
result = Object.assign(Object.assign({}, result), currentResult); | ||
} | ||
else if (!!v.items.enum) { | ||
const currentResult = propTrueType(v.items); | ||
result = Object.assign(Object.assign({}, result), currentResult); | ||
} | ||
else { | ||
result.propType = utils_1.toBaseType(v.items.type) + '[]'; | ||
if (v.type === "array" && v.items.oneOf && v.items.oneOf.length > 0) { | ||
result.isUnionType = true; | ||
result.propType = v.items.oneOf.map((type) => { | ||
return utils_1.refClassName(type.$ref); | ||
}).join(','); | ||
} | ||
else if (v.type === "array" && v.items.allOf && v.items.allOf.length > 0) { | ||
result.isCombinedType = true; | ||
result.propType = v.items.allOf.map((type) => { | ||
return utils_1.refClassName(type.$ref); | ||
}).join(','); | ||
} | ||
else if (v.items.type === "array") { | ||
const currentResult = propTrueType(v.items); | ||
result = Object.assign(Object.assign({}, result), currentResult); | ||
} | ||
else if (!!v.items.enum) { | ||
const currentResult = propTrueType(v.items); | ||
result = Object.assign(Object.assign({}, result), currentResult); | ||
} | ||
else { | ||
result.propType = utils_1.toBaseType(v.items.type) + '[]'; | ||
} | ||
} | ||
@@ -46,0 +53,0 @@ result.isArray = true; |
{ | ||
"name": "swagger-axios-codegen", | ||
"version": "0.10.4", | ||
"version": "0.10.5", | ||
"main": "./dist/index", | ||
@@ -5,0 +5,0 @@ "typings": "./dist/", |
Sorry, the diff of this file is not supported yet
267371
3993