Working with google.protobuf.Struct
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 716
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 10
Description
Hi, I have a gRPC server in Go with the following proto:
```
message Request {
google.protobuf.StringValue Id = 1;
google.protobuf.Struct Filter = 2;
}
```
I am writing a client in Node but I am not sure how to set the `Filter` field. I am using dynamic proto loading.
My imports:
```
const grpc = require('grpc');
const protoLoader = require('@grpc/proto-loader');
require('google-protobuf/google/protobuf/struct_pb');
```
I tried sending Struct field using follwoing ways:
1.
```
var item = new proto.google.protobuf.Struct({
fields: {
Name: {
string_value: 'name'
}
}
});
```
2.
```
const plainObj = { 'Name':'name' };
const item = proto.google.protobuf.Struct.fromJavaScript(plainObj);
```
Both ways did not work. I am receiving empty value on the server.
Thanks
Contributor guide
Assessment
This issue has not been assessed yet.