Optional fields support in protoc-gen-php-grpc
clement-95 opened this issue · comments
Hello fellow developers !
With the last versions of protobuf 3 we can now add optional fields but unfortunately this is not supported yet in protoc-gen-php-grpc. So when I'm compiling my protos, I get an error "proto/test.proto: is a proto3 file that contains optional fields, but code generator protoc-gen-php-grpc hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.--php-grpc_out:"
So here I am, do you plan to add the support of optional fields soon ? That's be awesome.
Thank you for your work !
Clement
I think that's the problem of protobuf library https://github.com/protocolbuffers/protobuf
As a workaround you can use next syntax
oneof optional_var {
int32 var = 1;
}
Under the hood protobuf anyway transform optional int32 var
into code like this
Sorry @clement-95 , the last version for this library was released today (1.6.0
). I have updated all libraries in it (protobuf v2, go 1.17, other deps).
This library is deprecated.
To use the latest features, please, use the roadrunner-grpc library with RR v2.