Skip to content

Commit

Permalink
refactor: fix yapi parse code type error
Browse files Browse the repository at this point in the history
  • Loading branch information
gogoyqj committed Jul 25, 2023
1 parent aa73ace commit 54d33e5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/yapi/yapi2swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,8 @@ export function convertResponse(api: SyntheticAPI, yapiConfig: Autos.YAPIConfig)
schemaObj = ejs(resBody);
}
if (schemaObj.properties && schemaObj.properties.code) {
if (typeof schemaObj.properties.code === 'object') {
// internal compatible
if (typeof schemaObj.properties.code === 'object' && !schemaObj.properties.type) {
schemaObj.properties.code.type = 'number';
}
}
Expand Down

0 comments on commit 54d33e5

Please sign in to comment.