Skip to content

Support for proto3 field presence #713

Open
@mt-inside

Description

@mt-inside

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions