Parsing JSON in Erlang

前端 未结 5 2022
一整个雨季
一整个雨季 2021-02-05 15:44

I have a piece of JSON string, which I want to parse in Erlang. It looks like:

({ id1 : [\"str1\", \"str2\", \"str3\"], id2 : [\"str4\", \"str5\"]})
5条回答
  •  孤独总比滥情好
    2021-02-05 15:59

    Your input is not quite JSON -- the keys need to be quoted, like this:

    { "id1" : ["str1", "str2", "str3"], "id2" : ["str4", "str5"]}
    

    A good Erlang library for manipulating JSON is jsx

提交回复
热议问题