Singlequotes not correct JSON?
eklem opened this issue · comments
Espen Klem commented
A small error in the documentation? Got error on singlequotes in JSON, it should be double-quotes, shouldn't it?
[
{
'id':'1',
'title':'A really interesting document',
'body':'This is a really interesting document',
'metadata':['red', 'potato']
},
{
'id':'2',
'title':'Another interesting document',
'body':'This is another really interesting document that is a bit different',
'metadata':['yellow', 'potato']
}
]
Espen Klem commented
I'll change the documentation when I know the answer.
Fergus McDowall commented
Yes, it seems that the doublequotes validate, yet the single quotes do not.
Stackoverflow seems to recommend double quotes http://stackoverflow.com/questions/14355655/jquery-parsejson-single-quote-vs-double-quote
Espen Klem commented
Eivind Eidheim Elseth commented
I'll just leave this here: http://json.org/
A string in JSON is delimited by "
. '
is legal in javascript, but not JSON.
Fergus McDowall commented
@EivindEE props for finding the actual definitive answer!