protobuf icon indicating copy to clipboard operation
protobuf copied to clipboard

Support for proto3 field presence

Open mt-inside opened this issue 4 years ago • 5 comments

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

mt-inside avatar Dec 01 '20 19:12 mt-inside

+1 to add support for optional fields

wespen avatar Apr 29 '21 20:04 wespen

I have the same issue.

gunsluo avatar Nov 03 '21 10:11 gunsluo

+1

devesh25427 avatar May 12 '22 14:05 devesh25427

+1

leeming87v5 avatar Jun 22 '22 06:06 leeming87v5

I have the same issue.

StrayLittlePunk avatar Aug 22 '22 09:08 StrayLittlePunk