diff --git a/firebase_rules_generator/generator.cc b/firebase_rules_generator/generator.cc index f59e85c..4c81bff 100644 --- a/firebase_rules_generator/generator.cc +++ b/firebase_rules_generator/generator.cc @@ -367,7 +367,7 @@ bool RulesGenerator::GenerateField(const protobuf::FieldDescriptor *field, case protobuf::FieldDescriptor::TYPE_DOUBLE: case protobuf::FieldDescriptor::TYPE_FLOAT: // TODO(rockwood): Do we need anything special for "Nan" or "Infinity"? - vars.insert({"type", "float"}); + vars.insert({"type", "number"}); printer.Print(vars, "resource.$name$ is $type$"); break; case protobuf::FieldDescriptor::TYPE_INT64: diff --git a/testdata/test4.rules b/testdata/test4.rules index 1c2ed04..742d260 100644 --- a/testdata/test4.rules +++ b/testdata/test4.rules @@ -8,6 +8,6 @@ function isExampleMessage(resource) { ((!resource.keys().hasAny(['bar'])) || (resource.bar is map)) && ((!resource.keys().hasAny(['bippity'])) || (resource.bippity is int && resource.bippity >= -2147483648 && resource.bippity <= 2147483647)) && ((!resource.keys().hasAny(['boppity'])) || (resource.boppity is bool)) && - ((!resource.keys().hasAny(['boo'])) || (resource.boo is float)); + ((!resource.keys().hasAny(['boo'])) || (resource.boo is number)); } // @@END_GENERATED_FUNCTIONS@@