-
Notifications
You must be signed in to change notification settings - Fork 384
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
Optional fields not supported in proto3 syntax #625
Comments
Interesting. Optional fields work, but when using If you need to run |
Thanks for the quick response. When you say it needs to be implemented: are you referring to actually implementing support for proto3 optional fields, or do you just mean telling protoc that we already do have support? |
The latter, only need to signal to proto3 optional is implemented, test. |
I believe #626 will do the trick |
Reopening until it is released. |
3.0.3 |
It's a backport of stepancheg#626. Fixes: stepancheg#625 Signed-off-by: Tim Zhang <[email protected]>
It's a backport of stepancheg#626. Fixes: stepancheg#625 Signed-off-by: Tim Zhang <[email protected]>
It's a backport of stepancheg#626. Fixes: stepancheg#625 Signed-off-by: Tim Zhang <[email protected]>
It's a backport of #626. Fixes: #625 Signed-off-by: Tim Zhang <[email protected]>
If I try to generate code with protoc-gen-rust i.e. with the command:
protoc --rust_out=out test.proto
I get the following error:Here's my
test.proto
file:Without the
optional
keyword the command does not raise an error. Likewise, if I change the syntax to proto2, the command does not raise an error.I installed
protoc-gen-rust
viacargo install protobuf-codegen
(version v3.0.2 was installed).OS version:
uname -a Linux 78ae9044ec23 5.10.104-linuxkit #1 SMP Wed Mar 9 19:05:23 UTC 2022 x86_64 Linux
Looking through the docs, it seems that optional fields should be supported, so I'm not sure if I'm doing something wrong or not. My goal is to end up with an Option in the generated rust code.
Thanks :)
The text was updated successfully, but these errors were encountered: