鉴于Json是这样的:

{
  "description": "foo \n bar"
}

如果我尝试创建 Hash(String, String) 使用方法 from_json 我收到以下错误:

Unexpected char '
' at 1:22 (JSON::ParseException)

我该如何正确解析它?

require "json"

Hash(String, String).from_json(%({"description": "foo \n bar"}))

https://play.crystal-lang.org/#/r/3ynh