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

sjson fails decoding multiline json with number or bool #2005

Closed
HHHartmann opened this Issue Jun 17, 2017 · 1 comment

Comments

Projects
None yet
3 participants
@HHHartmann
Contributor

HHHartmann commented Jun 17, 2017

Expected behavior

these exampled should be decodable (note the multiline)

{"number": 12
}

{"bool": false
}

Actual behavior

errors are thrown:
stdin:1: JSON parse error: INVALID_NUMBER
stdin:1: JSON parse error: SPECIAL_EXPECTED

Without the \n it works like a charm
Also strings have no problem

Test code

s = "{"number": 12\n}"
o = sjson.decode(s)
s = "{"bool": false\n}"
o = sjson.decode(s)

NodeMCU version

NodeMCU custom build by frightanic.com
branch: master
commit: c8ac5cf
SSL: true
modules: bit,file,gpio,http,i2c,net,node,ow,pwm,rtctime,sjson,sntp,tmr,uart,wifi,tls
build built on: 2017-06-17 17:53
powered by Lua 5.1.4 on SDK 2.1.0(116b762)

Hardware

standard esp8266 E12 DEV Board

@pjsg

This comment has been minimized.

Show comment
Hide comment
@pjsg

pjsg Jun 18, 2017

Collaborator

This was my bad. I only tested with spaces and I had a typo.....

Collaborator

pjsg commented Jun 18, 2017

This was my bad. I only tested with spaces and I had a typo.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment