jq is a great tool to parse json string on the command line. I had a case where serialized JSON is a value of a key in the outer JSON. It is possible to parse the serialized JSON string in jq.

echo '{"key": "{\"a\": 10, \"b\": 20}"}' | jq -r .key | jq .

Output is

{
  "a": 10,
  "b": 20
}
Advertisements