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

Check type is reference #14

Closed IchordeDionysos closed 6 years ago

IchordeDionysos commented 6 years ago

Hi, do you have an example on how I check if the type is a reference?

Or is this currently supported?

Thanks Dennis

P.S. I love this project, soooo awesome. I always wanted to start such a tool, but great that it already exists!

rockwotj commented 6 years ago

Currently you cannot. Protobuf doesn't have a type that really maps to a reference. Maybe if we had a special extension for a string type?

Proposal:

message Example {
  string ref = 1 [(google.firebase.rules.firebase_rules_field).reference_type = true];
}

Thoughts?

IchordeDionysos commented 6 years ago

That would do it, I think :)