3
如图,使用官方greet demo测试api dart代码自动生成时报错 是我哪里操作不对吗?
如图,使用官方greet demo测试api dart代码自动生成时报错 是我哪里操作不对吗?
I also got this error.
2021/02/16 19:31:38 gen.go:31 template: dataTemplate:13:45: executing "dataTemplate" at <.Type>: wrong type for value; expected string; got spec.PrimitiveType
+1 报同样的错误
goctl api dart --api account.api --dir . 2021/06/10 01:04:41 gen.go:32 template: dataTemplate:13:45: executing "dataTemplate" at <.Type>: wrong type for value; expected string; got spec.PrimitiveType
api定义如下
type RegisterRequest struct {
Email string `json:"email"` // 邮箱
Password string `json:"password"` // 密码长度大于6
Repassword string `json:"repassword"` // 重复密码
}
type RegisterResponse struct {
Uid int64 `json:"uid"` // uid账号ID
Token string `json:"token"` // 账号token
}
type LoginRequest struct {
Email string `json:"email"` // 邮箱
Password string `json:"password"` // 密码
}
type LoginResponse struct {
Uid int64 `json:"uid"` // uid
Token string `json:"token"` // 账号token
}
type RegInfoResponse struct {
Uid int64 `json:"uid"` // uid
Email string `json:"email"` // 邮箱
Phone string `json:"phone"` // 手机号
Status int64 `json:"status"` // 状态 0默认 1已激活 2已删除
CreateTime int64 `json:"createTime"` // 创建时间戳(秒级别)
UpdateTime int64 `json:"updateTime"` // 更新时间戳(秒级别)
}
@server(
group: account
)
service boom-api {
@doc "邮箱注册"
@handler RegisterHandler
post /api/user/register (RegisterRequest) returns (RegisterResponse);
@doc "邮箱登录"
@handler LoginHandler
post /api/user/login (LoginRequest) returns (LoginResponse);
}
@server(
jwt: Auth
middleware: AuthCheck
group: account
)
service boom-api {
@doc "注册信息"
@handler RegInfoHandler
get /api/user/reginfo () returns (RegInfoResponse)
}
+1,同样的错, gen.go:32 template: dataTemplate:13:45: executing "dataTemplate" at <.Type>: wrong type for value; expected string; got spec.PrimitiveType
谁熟悉dart的PR一下?:)