FirebaseExtended / protobuf-rules-gen

This is an experimental protoc plugin that generates Firebase Rules for Cloud Firestore based on Google's Protocol Buffer format. This allows you to easily validate your data in a platform independent manner.
Apache License 2.0
197 stars 13 forks source link

Support for `optional` in `proto3` #41

Open nilsreichardt opened 3 years ago

nilsreichardt commented 3 years ago

Description

If I'm using proto3 and try to use optional I get this error:

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

My proto file:

syntax = "proto3";

message User {
    optional string name = 1;
}
colin-williams commented 1 year ago

I wonder why it doesn't support optional. Does this represent a challenge to implement?

Aren't optional values pretty important in regards to protobuf? For example isn't one reasonable way to "version" messages to use the optional keyword for future versions of a message when adding fields?