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

Add google.protobuf.Any.unpack function #285

Closed
fubhy opened this issue Nov 3, 2022 · 3 comments
Closed

Add google.protobuf.Any.unpack function #285

fubhy opened this issue Nov 3, 2022 · 3 comments

Comments

@fubhy
Copy link
Contributor

fubhy commented Nov 3, 2022

Currently, in order to unpack into a message instance, you have to do:

  const any = ... // Some arbitrary `google.protobuf.Any` any.
  const message = registry.findMessage(typeName);
  const instance = new message!();
  any.unpackTo(instance);

It would be great if google.protobuf.Any was generated with a utility for that accepting a typeRegistry as input.

@smaye81
Copy link
Member

smaye81 commented Nov 3, 2022

Hey @fubhy. This was actually something on our roadmap also. Any interest in putting up a PR?

@fubhy
Copy link
Contributor Author

fubhy commented Nov 3, 2022

Yep. Will do!

@fubhy
Copy link
Contributor Author

fubhy commented Nov 3, 2022

#288

@smaye81 smaye81 closed this as completed Nov 16, 2022
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

2 participants