Skip to content
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

fix(hz): request parameter must be set in client scenario #1223

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions cmd/hz/thrift/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ func astToService(ast *parser.Thrift, resolver *Resolver, args *config.Argument)
if args.CmdType == meta.CmdClient {
clientMethod := &generator.ClientMethod{}
clientMethod.HttpMethod = method
if len(m.Arguments) == 0 { // request parameter is nil
return nil, fmt.Errorf("method '%s' request parameter must be set in client scenario", m.GetName())
}
rt, err := resolver.ResolveIdentifier(m.Arguments[0].GetType().GetName())
if err != nil {
return nil, err
Expand Down
Loading