fergiemcdowall / norch

A search server that can be installed with npm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Singlequotes not correct JSON?

eklem opened this issue · comments

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']
  }
]

I'll change the documentation when I know the answer.

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

I'll just leave this here: http://json.org/

A string in JSON is delimited by ". ' is legal in javascript, but not JSON.

@EivindEE props for finding the actual definitive answer!