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

-0 gets rejected as a number (error: "No digits after initial minus") #88

Closed
briancsinger opened this issue Jul 26, 2011 · 1 comment
Closed
Milestone

Comments

@briancsinger
Copy link

Parser rejects -0 as a legitimate number. Unless I'm reading the specs wrong, a json number is:
number = [ minus ] int [ frac ] [ exp ]

and an int is:
int = zero / ( digit1-9 *DIGIT )

I'm referencing: http://www.ietf.org/rfc/rfc4627.txt

A fairly easy workaround that I'm currently using is to replace -0 with 0 and then parsing. That's working for me.

(If you need some sample json strings I'm happy to provide)

@stig stig closed this as completed in 4355df0 Jul 27, 2011
@stig
Copy link
Collaborator

stig commented Jul 27, 2011

Hi. Thanks for reporting this. The issue should be fixed in master. I've also released 3.0.2 with this fix.

Stig

On 27 Jul 2011, at 04:32, briancsinger wrote:

Parser rejects -0 as a legitimate number. Unless I'm reading the specs wrong, a json number is:
number = [ minus ] int [ frac ] [ exp ]

and an int is:
int = zero / ( digit1-9 *DIGIT )

I'm referencing: http://www.ietf.org/rfc/rfc4627.txt

A fairly easy workaround that I'm currently using is to replace -0 with 0 and then parsing. That's working for me.

(If you need some sample json strings I'm happy to provide)

Reply to this email directly or view it on GitHub:
#88

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

No branches or pull requests

2 participants