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 unsigned, write longs as strings #101

Merged
merged 7 commits into from
Jul 12, 2023
Merged

Fix unsigned, write longs as strings #101

merged 7 commits into from
Jul 12, 2023

Conversation

jhaber
Copy link
Member

@jhaber jhaber commented Jul 11, 2023

Related to #76, #77, #98

This PR adds some new config options. In particular:

  • properUnsignedNumberSerialization will properly serialize uint32, fixed32, uint64, fixed64 (currently we sometimes write these as negative numbers)
  • serializeLongsAsString will write uint64, fixed64, sint64, sfixed64 as json string, as specified by protobuf spec
  • useCanonicalSerialization will enable the previous two options (and potentially more flags in the future, if new discrepancies are discovered)

/cc @stevie400 @Xcelled @suruuK

Copy link
Contributor

@stevie400 stevie400 left a comment

Choose a reason for hiding this comment

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

Nice! No real functional comments

@jhaber
Copy link
Member Author

jhaber commented Jul 12, 2023

I'm planning to do a follow-up PR to add an option for serializing Any according to the spec, and I can update the readme in that PR

@jhaber jhaber merged commit 8fc9f50 into master Jul 12, 2023
@jhaber jhaber deleted the jh/fix-unsigned branch July 12, 2023 15:03
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.

2 participants