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

Clarification of decoder behaviour #17

Open
mfridman opened this issue Feb 14, 2019 · 0 comments
Open

Clarification of decoder behaviour #17

mfridman opened this issue Feb 14, 2019 · 0 comments

Comments

@mfridman
Copy link

In the examples, GreetRequest is a simple struct with a single Name field. I was expecting to send the request as an object

{ "name": "mike" }

But I get the error:

decode json: json: cannot unmarshal object into Go value of type []*simplyProjected.SimpleRequest

If I send it as an array its fine. Is the expected behaviour of the decoder to assume an array of objects?

[{ "name": "mike" }]

https://github.com/machinebox/remoto/blob/master/examples/greeter/server/greeter/server.go#L90

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant