Having a Nestjs gRPC Client using a .proto file that contains message field names with an underscore leads to those fields not being sent and thus falling back to their defaults.
Does not work:
message ConfigNew {
int32 id = 1;
string test_string = 2;
}
works:
message ConfigNew {
int32 id = 1;
string teststring = 2;
}
Support for message field names, regardless whether they contain an underscore or not.
- Nest version: 7.2.0
- Node version: v12.16.2
- Platform: Linux
Please provide a minimum reproduction repository.
set keepCase
option to true
in microservice options.
I think this option should be true
by default, it's not at the moment.
Like this:
app.connectMicroservice<MicroserviceOptions>({
transport: Transport.GRPC,
options: {
package: 'test',
protoPath: 'path/to/proto',
loader: { keepCase: true },
},
});
set
keepCase
option totrue
in microservice options.
I think this option should betrue
by default, it's not at the moment.
Like this:app.connectMicroservice<MicroserviceOptions>({ transport: Transport.GRPC, options: { package: 'test', protoPath: 'path/to/proto', loader: { keepCase: true }, }, });
Yes, you are right! It works as expected when setting the loader options, thank you.
I think we should either enable this by default (if applicable) or at least mention in the docs, what do you guys think?
Let's track this here https://github.com/nestjs/docs.nestjs.com/issues/1297
Most helpful comment
Let's track this here https://github.com/nestjs/docs.nestjs.com/issues/1297