I have two json form. I tried to validate in jsonlint. It show error for first and it validate to second json.
Wrong json:
[ "name": {} ]
True json:
{ "name": {} }
Can any one explain why first one is wrong while second one true.
I have two json form. I tried to validate in jsonlint. It show error for first and it validate to second json.
Wrong json:
[ "name": {} ]True json:
{ "name": {} }Can any one explain why first one is wrong while second one true.
Copyright © 2021 Jogjafile Inc.
[starts an array initializer. Valid entries are values separated by comments. Example:{starts an object initializer. Valid entries are name/value pairs where each pair is a names in double quotes followed by a colon (:) followed by any valid value. Examples:All of this is covered by the website and the standard.
Your first example is invalid because it's trying to define a name/value pair where a value is expected (in an array entry).