Bug #10143
closedJSON module does not conform to RFC 7159
Description
From RFC 7159: http://tools.ietf.org/html/rfc7159
A JSON text is a serialized value. Note that certain previous
specifications of JSON constrained a JSON text to be an object or an
array.
This means that the following should be valid:
JSON.parse('1') JSON.parse('this is a string')
However, they each currently return a JSON::ParserError:
A JSON text must at least contain two octets!
or
757: unexpected token at 'this is a string'
Updated by naruse (Yui NARUSE) over 10 years ago
- Category set to ext
- Status changed from Open to Assigned
- Assignee set to naruse (Yui NARUSE)
- Priority changed from Normal to 3
- Target version set to 2.6
Updated by Anonymous about 10 years ago
I cannot find another linter that would accept this as input. example: http://www.jslint.com
I can however see that there are more examples of values in the RFC http://tools.ietf.org/html/rfc7159#section-13.
If I am reading this correctly strings, numbers and booleans can be passed.
So all the following should be valid.
JSON.parse('1')
JSON.parse('this is a string')
JSON.parse(42)
JSON.parse(true)
Updated by naruse (Yui NARUSE) about 10 years ago
- Status changed from Assigned to Third Party's Issue
discussing in upstream https://github.com/flori/json/issues/206