-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
int64生成的类型为string类型 #131
Comments
int64不应该被解析成string? |
为了保证精度是应该,但是我记得我以前使用openapi生成代码时long类型是转成number的,这样写dome的时候很方便 |
最近版本貌似忽然变了,让前端大量代码防不胜防,有没有回退或补救措施?? |
措施一:可以让作者发布1.9.3版本包,参数加上isCamelCase: false 措施二: 你可以自己下载指定的npm包,npm install @umijs/openapi@1.9.1,重新生成代码 |
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使用 openapi生成 Swagger 对应的前端代码时,发现 Long 类型在 Swagger 中被生成为 string 类型的前端代码,比如下面id和userId给生成成了string类型
// 前端生成的代码
type InterfaceInfoVO = {
createTime?: string;
description?: string;
id?: string;
isDeleted?: number;
method?: string;
name?: string;
requestHeader?: string;
requestParams?: string;
responseHeader?: string;
sdkToken?: string;
status?: number;
totalNum?: number;
updateTime?: string;
url?: string;
userId?: string;
};
// swagger
"InterfaceInfoVO": {
"title": "InterfaceInfoVO",
"type": "object",
"properties": {
"createTime": {
"type": "string",
"format": "date-time"
},
"description": {
"type": "string"
},
"id": {
"type": "integer",
"format": "int64"
},
"isDeleted": {
"type": "integer",
"format": "int32"
},
"method": {
"type": "string"
},
"name": {
"type": "string"
},
"requestHeader": {
"type": "string"
},
"requestParams": {
"type": "string"
},
"responseHeader": {
"type": "string"
},
"sdkToken": {
"type": "string"
},
"status": {
"type": "integer",
"format": "int32"
},
"totalNum": {
"type": "integer",
"format": "int32"
},
"updateTime": {
"type": "string",
"format": "date-time"
},
"url": {
"type": "string"
},
"userId": {
"type": "integer",
"format": "int64"
}
}
},
这个版本
"@umijs/plugin-openapi": "^1.3.3",
The text was updated successfully, but these errors were encountered: