Is a primitive type considered JSON?

后端 未结 3 858
粉色の甜心
粉色の甜心 2021-02-14 10:31

Most place the JSON is in format like

{
    color: \"red\",
    value: \"#f00\"
}

Or

[  
    { color: \"red\",     value: \"#f0         


        
3条回答
  •  别那么骄傲
    2021-02-14 11:23

    FWIW, here's output from the command line JSON parser prgram jq:

    $ echo "{ foo }" | jq .
    parse error: Invalid literal at line 1, column 6
    
    $ echo "{ \"foo\" }" | jq .
    parse error: Objects must consist of key:value pairs at line 1, column 9
    
    $ echo "\"foo\"" | jq .
    "foo"
    

    I don't have access to other parser at the moment.

提交回复
热议问题