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
(2.6 and 3.0) fix json parser e+ bug #1492
Conversation
Given that this isn't a mission-critical bug, I don't know that it merits a special release of 2.4. 👍 for the fix to land in 2.6 and 3.0, however. |
Er… Actually… Before I forget… Did you discuss this on the mailing list before issuing the PR? It doesn't look like it. Please read the contribution guidelines, which are listed whenever you open an issue or pull request. |
@Shadowfiend Ups, sorry about that. It's my very first pull-request. Just wrote to the mailing list: https://groups.google.com/forum/#!topic/liftweb/dvlgelrPfFg The change is pretty small, but the issue is critical to me - I use lift-json to parse json from third-party services and one of them returns numbers in this format, which is valid json, but can't be parsed by lift-json. By submitting this pull request which includes my name and email address Name:Mikhail Strebkov Email:strebkov @@ gmail .. com |
On Tue, Sep 10, 2013 at 8:04 AM, kluyg notifications@github.com wrote:
Prior to the 2.5 release, we only accepted contributions from committers.
We will only roll this into Master and lift_30. We will not backport it Also, we'll have to wait for Joni Freeman (who owns the lift-json module)
Telegram, Simply Beautiful CMS https://telegr.am |
I see. Great that this was relaxed.
I see. I can live with my own jar's until lift_30. So should I remove pull-request and prepare another one for master? Or remove and wait for Joni Freeman? |
Looks good to me. Double checked the spec too and [num] e+ [exp] is a valid representation for a decimal number. |
Joni -- Thanks for your thumbs up. Let's get this into master and I'm pretty sure one of the code gnomes will On Tue, Sep 10, 2013 at 9:16 AM, Joni Freeman notifications@github.comwrote:
Telegram, Simply Beautiful CMS https://telegr.am |
rebased to master, thanks! |
According to http://www.json.org/ the double in JSON can be represented in scientific notation, and e symbol can be one of the following:
e
e+
e-
E
E+
E-
net.liftweb.json.parse was working ok with e, e-, E, E- but was throwing exception "can't parse" for e+ and E+.
Added unit test (was failing). Added c == '+' analogous to c == '-' to JsonParser.scala. This fixed unit test.
P.S. The same issue exists in master, but we use 2.4 so I fixed it in 2.4 branch. The change is atomic and can be merged to any lift version, including master.