-
Notifications
You must be signed in to change notification settings - Fork 636
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
Support ambiguous types with the Any
protobuffer.
#375
Comments
Yo, my dudes! Just wondering what's going on! |
I'm sorry for the late response. I didn't see this issue when it was first filed. There are a few things to unpack here. First, |
Hey! Thanks for responding @murgatroid99.
Also, I think it would be in the best interests of the project to deprecate the Thanks Murg! |
I can't figure out if this is fixed and available in grpc 1.12.4? It might be that I don't understand how the Any type works, but I haven't been able to find any examples of how it's supposed to be set. If I have an arbitrary JSON object, which I want to send as a |
First, it's kind of confusing but |
Thanks, that was helpful :) For other people that get here, you can use let data = {
foo: "bar"
}
const struct = Struct.fromJavaScript(data)
data = struct.toJavaScript() |
That was the money answer Jamie.
+10, can we have additional documentation?
Do you need help documenting and writing example?
On Mon, Jun 25, 2018 at 4:55 PM Jamie Talbot ***@***.***> wrote:
Thanks, that was helpful :) For other people that get here, you can use
goog.protobuf.Struct to serialise and deserialise json like this:
let data = {
foo: "bar"
}const struct = Struct.fromJavaScript(data)
data = struct.toJavaScript()
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#375 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ABfSA3g-TEzWeElex5_72wMMmR_Vc_JCks5uAU4lgaJpZM4UOt01>
.
--
Chris Cates, Software Developer
|
Documentation pull requests should always be welcome, as long as the CLA is signed, yes. Also the website's source is over there: https://github.com/grpc/grpc.github.io |
Sounds good! @nicolasnoble, let's continue discussion when I make a Pull Request. |
Is your feature request related to a problem? Please describe.
Currently, the
Any
datatype is not supported by Node.js... This can be pretty troublesome, due to the nature of the language. Inheriting and transmitting legacy data is essentially impossible with GRPC in Node.js.Describe the solution you'd like
It would be nice for Node.js to support the
Any
datatype, and for it to be able topack
andunpack
data with ease.Additional context
I'm available to review and update the codebase with support for this annotation.
I actually noticed that default definition imports don't work...
Example:
Will throw an error with the native
.load()
function.So it would be nice to fix this up... And also support annotations like I've mentioned without the need for the module
@grpc/proto-loader
.The text was updated successfully, but these errors were encountered: