Skip to content

Commit

Permalink
Merge pull request #77 from gogoyqj/fix-yapi-incompatible-swagger
Browse files Browse the repository at this point in the history
Fix yapi incompatible swagger
  • Loading branch information
gogoyqj committed Jul 27, 2023
2 parents deca45e + 99a5906 commit edaf071
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "auto-service",
"version": "4.0.8",
"version": "4.0.9",
"description": "auto generate swagger or yapi mock to typescript services and models",
"repository": "[email protected]:gogoyqj/auto-service.git",
"author": "yangqianjun <yang@yang>",
Expand Down
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 edaf071

Please sign in to comment.