Skip to content

Commit

Permalink
fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
Manweill committed Jan 19, 2024
1 parent 24c7cf8 commit 956ac43
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/componentsCodegen/propTrueType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export function propTrueType(v: IDefinitionProperty): {
}
// 基本类型
else {
result.propType = toBaseType(v.type, v.items.format)
result.propType = toBaseType(v.type, v.items?.format)
}
return result
}
Expand Down
4 changes: 2 additions & 2 deletions src/definitionCodegen/propTrueType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function propTrueType(v: IDefinitionProperty): {
const currentResult = propTrueType(v.items)
result = { ...result, ...currentResult }
} else {
result.propType = toBaseType(v.items.type) + '[]'
result.propType = toBaseType(v.items.type, v.items?.format) + '[]'
}
}
result.isArray = true
Expand All @@ -52,7 +52,7 @@ export function propTrueType(v: IDefinitionProperty): {
}
// 基本类型
else {
result.propType = toBaseType(v.type)
result.propType = toBaseType(v.type, v?.format)
}
return result
}
Expand Down
2 changes: 1 addition & 1 deletion src/requestCodegen/getRequestParameters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export function getRequestParameters(params: IParameter[], useHeaderParameters:
}
// 基本类型
else {
propType = toBaseType(p.type, p.format)
propType = toBaseType(p.type, p?.format)
}

const paramName = camelcase(p.name)
Expand Down

0 comments on commit 956ac43

Please sign in to comment.