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

[java] Add config option to print 64-bit integers in JSON as unquoted ints if they can be losslessly converted into a 64-bit float #16270

Closed
mlmitch opened this issue Mar 22, 2024 · 2 comments
Labels
inactive Denotes the issue/PR has not seen activity in the last 90 days. untriaged auto added to all issues by default when created.

Comments

@mlmitch
Copy link

mlmitch commented Mar 22, 2024

The title of this issue is taken from the following commit made in March 2023.
330e10d

That commit added a configuration option to the C++ JSON printer for printing 64-bit integers in JSON as unquoted ints if they can be losslessly converted into a 64-bit float. This issue is a request for a similar configuration option to be added to the Java JSON printer.

What language does this apply to?
This applies to the JSON printing functionality in the util libraries.
I am primarily concerned with Java.

Describe the problem you are trying to solve.
I have a need to export protobuf integers in the range of (2^32, 2^53) as JSON numbers instead of as decimal strings.
I want to be able to do this without sacrificing the benefits of using an integer type in my protobuf definitions.

Describe the solution you'd like
The solution in the linked commit seems great to me and its functionality already in the protobuf codebase.
Similar functionality in Java and other languages seems most appropriate.

Describe alternatives you've considered
Other solutions are talked about in the linked issues below. None of them resulted in an implementation.

Additional context

Something like this has been in high demand from the community for a while. Some previous issues around this topic:

Copy link

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.

This issue is labeled inactive because the last activity was over 90 days ago.

@github-actions github-actions bot added the inactive Denotes the issue/PR has not seen activity in the last 90 days. label Jun 21, 2024
Copy link

github-actions bot commented Jul 6, 2024

We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please reopen it.

This issue was closed and archived because there has been no new activity in the 14 days since the inactive label was added.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inactive Denotes the issue/PR has not seen activity in the last 90 days. untriaged auto added to all issues by default when created.
Projects
None yet
Development

No branches or pull requests

1 participant