Actions
Bug #4244
closedPsych.to_json generate incorrect JSON
Description
=begin
Psych.to_json could be presumed to return JSON because of its name.
But Psych.to_json generate single-quoted string. It isn't valid JSON format.
require "psych"
=> true
Psych.to_json("aaa")
=> "'aaa'\n"
Psych.to_json(["a","b","c"])
=> "['a', 'b', 'c']\n"
require "json"
=> true
JSON.parse(Psych.to_json(["a","b","c"]))
JSON::ParserError: 376: unexpected token at ''a', 'b', 'c']
'
=end
Actions
Like0
Like0Like0Like0