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

Allow leading zeros in JSON scientific notation #565

Closed
wants to merge 1 commit into from

Conversation

kristoff3r
Copy link
Contributor

I encountered a JSON file in the wild I couldn't parse using the JSON module, because it had a number with an exponent with a leading zero. According to https://stackoverflow.com/questions/19554972/json-standard-floating-point-numbers this should be allowed.

@stepancheg
Copy link
Owner

Yep, protoc parser seems to allow it as well:

syntax = "proto2";

message Foo {
    optional float f = 1 [default = 1.0e09];
}

@stepancheg
Copy link
Owner

Thanks! Merged as 0f1bbc9 with test added.

Released as 2.25.1, although in v2 version there's no JSON or protobuf text format parsing, but it affects .proto parsing.

@stepancheg stepancheg closed this Aug 21, 2021
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