From: Torsten Robitzki Date: 2012-07-19T18:36:29+09:00 Subject: Re: JSON.parse string Bartosz DziewoƄski wrote in post #1069285: > Because that's how proper JSON is formatted? The toplevel "item" must > be an array or an object. From json.org, I read that a json value can be a string, a number, an object, an array, true, false or null. So I wonder, why "string" is treated different from []. By the way, "string".to_json works as expected: > "string".to_json => "\"string\"" > If it isn't, then you probably should be using plain text insted of JSON. I'm implementing a protocol, where the payload is a JSON encoded value and I think "string" is a valid JSON expression. Kind regards Torsten -- Posted via http://www.ruby-forum.com/.