-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
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
Is there a way to use google.protobuf.Any in NestJs (gRPC/proto3) #4621
Comments
Please, use our Discord channel (support) for such questions. We are using GitHub to track bugs, feature requests, and potential improvements. |
@imi187 hello, did you solve this yet, I have the same issue with you, and already try to ask on discord, but I still not get an answer. |
(@imtosss123 ) Nope, I did not. I put the label "Question" on it so they told me to ask it on Discord. After a long search I did not find a way to get the raw message in NestJS For the moment it helps but we will have to change it in the future. Proto needs to know your type to reserve memory for that specific type. They provided a google.protobuf.Any. But you can only buffer it. You can always use the library in node proto3 without using NestJs. Hope It helps. |
@imtosss123 @imi187 In the future, it would be helpful to have a minimum reproduction and not jsut code snippets. Something that can be cloned, have its dependencies installed, and ran. I ended up making a reproduction to test this morning, and while I saw the problem you're facing, I also found this issue from the |
I can't find a way neither with serialization method in your options while starting the server like RMQ nor a transform-interceptor.
I read there are ways:
protocolbuffers/protobuf-javascript#68
https://developers.google.com/protocol-buffers/docs/proto3#any
But nothing is provided to get the raw message only pre-formated.
If I use google.protobuf.Any in my *.proto file it return a empty object in my message while I give a object with params and value's.
*.proto
Interface
Method in Client
Result in Server
Thx Imi.
The text was updated successfully, but these errors were encountered: