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

Support code generation for proto definitions utilizing experimental features #607

Open
Archisman-Mridha opened this issue Jan 19, 2023 · 1 comment

Comments

@Archisman-Mridha
Copy link

Is your feature request related to a problem? Please describe.
Programmatic code generation is not working if I use experimental gRPC features like the optional keyword in proto definition files.

Describe the solution you'd like
To generate code for proto files utilizing experimental features, we need to add --experimental_allow_proto3_optional to the protoc command while generating code. Please provide an option where we can enable or disable this flag in the compile_grpc_protos method.

Describe alternatives you've considered
I couldn't find any alternative to get through this problem.

Additional context
This is the error I am getting when I am trying to generate code -

This file contains proto3 optional fields, but --experimental_allow_proto3_optional was not set.
@Archisman-Mridha
Copy link
Author

Instead of using the optional field, I tried this -

import "google/protobuf/wrappers.proto";

message RegistrationResponse {
    google.protobuf.StringValue error= 1;

    string jwt= 2;
}

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

1 participant