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

ffi-yajl should parse bare objects for ruby-yajl compat #16

Closed
lamont-granquist opened this issue Sep 18, 2014 · 6 comments · Fixed by #32
Closed

ffi-yajl should parse bare objects for ruby-yajl compat #16

lamont-granquist opened this issue Sep 18, 2014 · 6 comments · Fixed by #32
Labels
Type: Bug Does not work as expected.

Comments

@lamont-granquist
Copy link
Contributor

Python, JS and ruby-yajl allow this kind of parsing (note closely the single-quote-double-quotes):

[2] pry(main)> Yajl::Parser.parse("1")
=> 1
[4] pry(main)> Yajl::Parser.parse('"a"')
=> "a"
@coderanger
Copy link

👍

@coderanger
Copy link

Also true, false, and null for completeness.

@lamont-granquist
Copy link
Contributor Author

do you mean "null" or nil? there's #15 open already

@lamont-granquist
Copy link
Contributor Author

this is also technically a dup of #1

@lamont-granquist
Copy link
Contributor Author

and to be clear, here's yajl-ruby's behavior:

[2] pry(main)> Yajl::Parser.parse("null")
=> nil
[3] pry(main)> Yajl::Parser.parse(nil)
Yajl::ParseError: input must be a string or IO
[4] pry(main)> Yajl::Parser.parse("true")
=> true
[5] pry(main)> Yajl::Parser.parse("false")
=> false

@coderanger
Copy link

I meant the JSON literal null, though I guess it is just kind of just supported by default :)

lamont-granquist added a commit that referenced this issue Nov 22, 2014
@chef chef locked and limited conversation to collaborators Nov 16, 2017
@tas50 tas50 added Type: Bug Does not work as expected. and removed bug labels Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Does not work as expected.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants