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

responses that can't be decoded into a map don't work #678

Open
dzfranklin opened this issue Oct 4, 2023 · 0 comments
Open

responses that can't be decoded into a map don't work #678

dzfranklin opened this issue Oct 4, 2023 · 0 comments
Labels

Comments

@dzfranklin
Copy link

Describe the bug

evans fails if the response can't be decoded into a map. for example for a google.protobuf.StringValue I see

command call: json: cannot unmarshal string into Go value of type map[string]interface {}

To reproduce

call an rpc method that returns a google.protobuf.StringValue

Expected behavior

I see the string value printed

Environment

  • OS: Linux
  • Terminal: alacritty
  • Evans version: 0.10.11
  • protoc version: 3.12.4
  • protoc plugin version (if you are using):

Additional context

I believe the root cause is that the formatter attempts to decode the message into a map[string]interface{} and then json print that, which obviously fails on a string.

if err := gojson.Unmarshal(buf.Bytes(), &res); err != nil {

@dzfranklin dzfranklin added the bug label Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant