Skip Menu |
 

This queue is for tickets about the JSON-PP CPAN distribution.

Report information
The Basics
Id: 90319
Status: resolved
Priority: 0/
Queue: JSON-PP

People
Owner: Nobody in particular
Requestors: dwheeler [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Big Number 0 should not Encode as a String
Date: Tue, 12 Nov 2013 15:36:46 -0800
To: bug-json [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
Download (untitled) / with headers
text/plain 713b
With `allow_bignum`, BigFloats and BigInts usually properly encode as JSON numbers. Show quoted text
> perl -MJSON::PP -MMath::BigInt -MMath::BigFloat -E 'say JSON::PP->new->allow_bignum->encode([Math::BigInt->new("1"), Math::BigFloat->new("1.0")])'
[1,1] Looks good. But change those values to 0s and it's not so good: Show quoted text
> perl -MJSON::PP -MMath::BigInt -MMath::BigFloat -E 'say JSON::PP->new->allow_bignum->encode([Math::BigInt->new("0"), Math::BigFloat->new("0.0")])'
["0","0"] Oops! Why are those zeros encoded as JSON strings? Not sure if it's something in the Math::Big* modules or JSON, but either way, it's not what I would expect. Best, David PS: Would love to see bignum support in JSON::XS, too!
Subject: [rt.cpan.org #90319]
Date: Fri, 21 Nov 2014 10:37:40 -0500
To: bug-JSON [...] rt.cpan.org
From: Jean-Louis Martineau <martineau.jl [...] gmail.com>
Download (untitled) / with headers
text/plain 127b
It works correctly in 2.53, 2.57 and 2.58, the zeros are number It started to fail in 2.59, the zeros are strings. Jean-Louis
Download (untitled) / with headers
text/plain 104b
Hi, I've produced a Pull Request for this issue here: https://github.com/makamaka/JSON/pull/22 Enjoy.
Download (untitled) / with headers
text/plain 186b
On Mon Jan 26 08:54:38 2015, DAMS wrote: Show quoted text
> Hi, > > I've produced a Pull Request for this issue here: > > https://github.com/makamaka/JSON/pull/22 > > Enjoy.
Thanks. Has been applied.
Download (untitled) / with headers
text/plain 289b
On Thu Oct 20 15:15:05 2016, ISHIGAKI wrote: Show quoted text
> On Mon Jan 26 08:54:38 2015, DAMS wrote:
> > Hi, > > > > I've produced a Pull Request for this issue here: > > > > https://github.com/makamaka/JSON/pull/22 > > > > Enjoy.
> > Thanks. Has been applied.
Closed as 2.92 was released. Thanks.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.