Page 1 of 1
JSON Validator not accepting top level arrays.
Posted: Fri Sep 30, 2011 2:06 pm
by jannylun
Moi!
The built-in JSON Validator does not consider top level arrays as valid JSON. Top level arrays may not be the preferred solution, but I believe they are valid JSON. Please check the behavior of the validator.
Br,
Jan
Re: JSON Validator not accepting top level arrays.
Posted: Fri Sep 30, 2011 3:48 pm
by Radu
Hi Jan,
Can you give me a small example of JSON code that the editor considers as invalid?
Regards,
Radu
Re: JSON Validator not accepting top level arrays.
Posted: Fri Sep 30, 2011 11:08 pm
by jannylun
Hello Radu!
For example:
Code: Select all
[
{
"color": "red",
"value": "#f00"
},
{
"color": "green",
"value": "#0f0"
}
]
or
Gives error:
Code: Select all
E [JSON Validator] A JSONObject text must begin with '{'
These are valid according to for example jsonlint.com.
Another thing is that oxygen approves strings that are not wrapped in quotes, so this is considered valid in oxygen:
While jsonlint.com says:
Code: Select all
Parse error on line 1:
{ color: "red", va
-----^
Expecting 'STRING', '}'
//Jan
Re: JSON Validator not accepting top level arrays.
Posted: Mon Oct 03, 2011 10:30 am
by Radu
Hi Jan,
You're right in both cases, I registered both issues to our internal bugs list and I'll update this forum post with more details when they are implemented.
Regards,
Radu
Re: JSON Validator not accepting top level arrays.
Posted: Mon Oct 03, 2011 8:37 pm
by jannylun
Thanks!
Re: JSON Validator not accepting top level arrays.
Posted: Tue Oct 04, 2011 5:12 pm
by Radu
Hi Jan,
In Oxygen 13.1 (which will be available in a couple of weeks) you will be able to validate, format and indent and edit in the Grid page also JSON Arrays.
The other problem (missing quotes to the key not reported as errors) will probably be fixed in a future version.
Regards,
Radu
Re: JSON Validator not accepting top level arrays.
Posted: Thu Aug 15, 2013 1:50 pm
by Radu
Hi,
Just to update this post, this issue:
The other problem (missing quotes to the key not reported as errors) will probably be fixed in a future version.
was fixed in Oxygen 15.0 which should report it as an error.
Regards,
Radu