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 for proto3 field presence #713

Open
mt-inside opened this issue Dec 1, 2020 · 5 comments · May be fixed by #770
Open

Support for proto3 field presence #713

mt-inside opened this issue Dec 1, 2020 · 5 comments · May be fixed by #770

Comments

@mt-inside
Copy link

Apologies if this is a dup, weirdly I can't find any issues for it.

I'm using gogo to produce protobuf structs, and it's rejecting a proto3 file with an optional field in.
versions.proto: is a proto3 file that contains optional fields, but code generator protoc-gen-gogo hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.--gogo_out:

My protoc invocation:

    -I "api-common-protos" \
    -I "api/v1alpha1" \
    --experimental_allow_proto3_optional \
    --descriptor_set_out="api/v1alpha1/versions.proto.pb" \
    --include_imports \
    --gogo_out="api/v1alpha1" \
    --gogo_opt=paths=source_relative \
    ...

I might be doing something wrong; I don't even really know how to gather version numbers of everything becuase oh boy is proto & grpc confusing!

protoc-gen-gogo is up-to-date, installed just now with go get -u github.com/gogo/protobuf/protoc-gen-gogo

@wespen
Copy link

wespen commented Apr 29, 2021

+1 to add support for optional fields

@gunsluo
Copy link

gunsluo commented Nov 3, 2021

I have the same issue.

@devesh25427
Copy link

+1

1 similar comment
@leeming87v5
Copy link

+1

@StrayLittlePunk
Copy link

I have the same issue.

@biosvs biosvs linked a pull request Jul 27, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

6 participants