googleapis / googleapis/gapic-showcase
Extreme field value for 32-bit floating point field is returned with a too-large value
- Dominant language
- Go
- Stars
- 183
- Forks
- 55
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 8
Description
We can exercise the maximum 32-bit floating point value like this:
```sh
curl -H "X-Goog-Api-Client: gapic/ rest/" 'http://localhost:7469/v1beta1/repeat:query?info.fFloat=3.40282346638528859811704183484516925440e%2B38'
```
The response includes (other fields trimmed):
```json
"request": {
"info": {
"fFloat": 3.4028235e+38
}
}
```
This can't be parsed by the .NET protobuf parser, because 3.4028235e+38 is outside the range of a 32-bit floating point number.
(We parse the value as a 64-bit floating point number, then check whether the value is greater than the maximum 32-bit floating point number - which in this case it is.)
The proto3 JSON specification isn't entirely clear on how limits should be applied.
Is this a standard protobuf JSON formatter that's emitting this value?
Contributor guide
Assessment
This issue has not been assessed yet.