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

Comparison of missing values to null will always fail #6

Closed naturalethic closed 6 years ago

naturalethic commented 6 years ago

So instead of doing this: ((resource.foo == null) || (resource.foo is string))

do this: ((!resource.keys().hasAny(['foo'])) || (resource.foo is string))

rockwotj commented 6 years ago

Thanks for opening these issues, they'll be fixed in an hour or so and I'll push a new release!