alpancs / protoc-gen-pubsub-schema

protoc-gen-pubsub-schema is a protoc plugin that assembles protocol buffer messages into a single-valid message for defining Pub/Sub schemas
Apache License 2.0
4 stars 2 forks source link

Permit `optional` fields in `proto3` #18

Open DazWilkin opened 11 months ago

DazWilkin commented 11 months ago

"Protobuf release 3.12 adds experimental support for optional fields in proto3".

foo.proto:

syntax = "proto3";

message Foo {
    optional string id = 1;
}

But:

protoc \
--proto_path=${PWD} \
--pubsub-schema_out=${PWD} \
--pubsub-schema_opt=message-encoding-json \
--pubsub-schema_opt=schema-syntax=proto3 \
${PWD}/foo.proto

Yields:

foo.proto: is a proto3 file that contains optional fields, but code generator protoc-gen-pubsub-schema hasn't been updated to support optional fields in proto3. Please ask the owner of this code generator to support proto3 optional.