FloatRules describes the rules applied to float values. These
rules may also be applied to the google.protobuf.FloatValue Well-Known-Type.
FloatRules describes the rules applied to float values. These
rules may also be applied to the google.protobuf.FloatValue Well-Known-Type.
Optional[customReturns a safe value for JSON logs.
Returns a safe value for JSON logs.
Optional[unknownPreserves protobuf fields that this SDK version does not recognize.
Contains the fully qualified protobuf type name.
Optionalconstconst requires the field value to exactly match the specified value. If
the field value doesn't match, an error message is generated.
message MyFloat {
// value must equal 42.0
float value = 1 [(buf.validate.field).float.const = 42.0];
}
example specifies values that the field may have. These values SHOULD
conform to other rules. example values will not impact validation
but may be used as helpful guidance on how to populate the given field.
message MyFloat {
float value = 1 [
(buf.validate.field).float.example = 1.0,
(buf.validate.field).float.example = inf
];
}
Optionalfinitefinite requires the field value to be finite. If the field value is
infinite or NaN, an error message is generated.
OptionalgreaterContains the selected value for the greater_than protobuf oneof.
Contains the case.
Contains the gt.
Contains the case.
Contains the gte.
in requires the field value to be equal to one of the specified values.
If the field value isn't one of the specified values, an error message
is generated.
message MyFloat {
// value must be in list [1.0, 2.0, 3.0]
float value = 1 [(buf.validate.field).float = { in: [1.0, 2.0, 3.0] }];
}
OptionallessContains the selected value for the less_than protobuf oneof.
Contains the case.
Contains the lt.
Contains the case.
Contains the lte.
in requires the field value to not be equal to any of the specified
values. If the field value is one of the specified values, an error
message is generated.
message MyFloat {
// value must not be in list [1.0, 2.0, 3.0]
float value = 1 [(buf.validate.field).float = { not_in: [1.0, 2.0, 3.0] }];
}
FloatRules describes the rules applied to
floatvalues. These rules may also be applied to thegoogle.protobuf.FloatValueWell-Known-Type.