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

Generated node files have no set method for map types #4356

Closed
jonahbron opened this issue Mar 6, 2018 · 2 comments
Closed

Generated node files have no set method for map types #4356

jonahbron opened this issue Mar 6, 2018 · 2 comments
Labels

Comments

@jonahbron
Copy link

jonahbron commented Mar 6, 2018

My Proto file looks something like this:

message ProviderLoginUrlRequest {
  string name = 1;
  string redirect_uri = 2;
  map<string, string> state = 3;
}

The string properties have these methods:

  • getName
  • setName
  • getRedirectUri
  • setRedirectUri

But the map type has only these two methods:

  • getStateMap
  • clearStateMap

Is this an intentional decision, or a bug? Is there not supposed to be a way to set map properties?

@jonahbron
Copy link
Author

jonahbron commented Mar 6, 2018

Never mind! I figured out that the property always at least has an empty Map object. To add properties to it, do...

instance.getStateMap().set('key', 'val');

Hopefully other people will find this googling the same symptoms I was.

@zhushenhang
Copy link

same issue.
Finally found a solution !!
thanks very much !!!

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

3 participants