Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use quotes around extreme int64 values #1206

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

jskeet
Copy link
Contributor

@jskeet jskeet commented Sep 6, 2022

JSON numbers are only really expected to be precise as far as IEEE-754 64-bit binary floating point numbers; that means precision is lost for very large integers.
The proto3 JSON specification says that 64-bit integers should be encoded as strings, although numeric values can be parsed.

Fixes #1205

JSON numbers are only really expected to be precise as far as IEEE-754 64-bit binary floating point numbers; that means precision is lost for very large integers.
The proto3 JSON specification says that 64-bit integers should be encoded as strings, although numeric values can be parsed.

Fixes googleapis#1205
@jskeet jskeet requested a review from vchudnov-g September 6, 2022 14:33
@jskeet jskeet requested a review from a team as a code owner September 6, 2022 14:33
Copy link
Contributor

@vchudnov-g vchudnov-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this!
I believe Showcase itself should be JSON-encoding int64 as strings, but LMK if you find otherwise.

@jskeet
Copy link
Contributor Author

jskeet commented Sep 6, 2022

Yup, it looks like it is. Thanks for the LGTM - merging now.

@jskeet jskeet merged commit c9d9ff1 into googleapis:main Sep 6, 2022
@jskeet jskeet deleted the fix-int64 branch September 6, 2022 17:17
gcf-merge-on-green bot pushed a commit that referenced this pull request Mar 7, 2023
🤖 I have created a release *beep* *boop*
---


## [0.26.0](https://togithub.com/googleapis/gapic-showcase/compare/v0.25.0...v0.26.0) (2023-03-07)


### Features

* **go:** Update Go version to 1.19 ([#1225](https://togithub.com/googleapis/gapic-showcase/issues/1225)) ([d4b108e](https://togithub.com/googleapis/gapic-showcase/commit/d4b108e16dc91c0ea6d4dec3dca4d3270d3bf47a))


### Bug Fixes

* Build assets for darwin/arm64 ([#1267](https://togithub.com/googleapis/gapic-showcase/issues/1267)) ([0833a57](https://togithub.com/googleapis/gapic-showcase/commit/0833a579131c14582b053f26698fdfe93e465d87))
* Export showcase_v1beta1.yaml from BUILD.bazel to support external GAPIC generation ([#1223](https://togithub.com/googleapis/gapic-showcase/issues/1223)) ([5076348](https://togithub.com/googleapis/gapic-showcase/commit/507634898e208b7ff88784e4ec5f0efd22bff9ab))
* Handle x-http-method-override for PATCH as POST ([#1262](https://togithub.com/googleapis/gapic-showcase/issues/1262)) ([4070ce3](https://togithub.com/googleapis/gapic-showcase/commit/4070ce331bd5e852ccb2f4f2267dce80a9dda9c4))
* Use quotes around extreme int64 values ([#1206](https://togithub.com/googleapis/gapic-showcase/issues/1206)) ([c9d9ff1](https://togithub.com/googleapis/gapic-showcase/commit/c9d9ff191bfd72fe8563625be4074fe4659585d6)), closes [#1205](https://togithub.com/googleapis/gapic-showcase/issues/1205)

---
This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

64-bit integers should be represented as strings in JSON
2 participants