Project

General

Profile

Actions

Bug #14054

closed

Json parser bug

Bug #14054: Json parser bug

Added by spuyet (Sébastien Puyet) about 8 years ago. Updated about 8 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
[ruby-core:83564]

Description

Hello,

When i do:

JSON.parse("true") # => JSON::ParserError: 784: unexpected token at 'true'
true.to_json # => "true"

The "true" or even "false" are valid according to the JSON standard (https://tools.ietf.org/html/rfc7159):

WDYT about this ?

Cheers,

Sébastien

Updated by shyouhei (Shyouhei Urabe) about 8 years ago Actions #1 [ruby-core:83569]

  • Status changed from Open to Rejected

It's just because your copy of json gem is too old.

[1] pry(main)> require 'json'
=> true
[2] pry(main)> JSON::VERSION
=> "2.1.0"
[3] pry(main)> JSON.parse("true")
=> true
[4] pry(main)>
Actions

Also available in: PDF Atom