douglascrockford/JSLint — Issue #99: Whitespace in JSON validation
Author: mark-repixl
Created: 2012-01-30 09:49:46+00:00
State: open

Problem: insignificant whitespace expected before structural characters.

Excerpt from RFC4627: "Insignificant whitespace is allowed before or after any of the six structural characters."

Input:
var a = {"foo":{"bar":"baz"}};

Output:

Problem at line 1 character 16: Missing space between ':' and '{'.
var a = {"foo":{"bar":"baz"}};

Problem at line 1 character 23: Missing space between ':' and 'baz'.
var a = {"foo":{"bar":"baz"}};

Change input to:
var a = {"foo": {"bar": "baz"}};

Output: JSON validates.