It fails here,
message = "{\"response\":{\"billDetails\":\"[{\"name\":\"Account ID\"}]\"}}"
JSON.parse(message)
JSON::ParserError (809: unexpected token at '{"response":{"billDetails":"[{"name":"Account ID"}]"}}')
CodePudding user response:
I'm not sure this will be helpful. But your json string should be written from
"{
"response":{
"billDetails": "[{"name":"Account ID"}]"}
}"
To:
'{
"response":{
"billDetails": [{"name":"Account ID"}]
}
}'
In the array from billDetails, you have two aditional ", that provokes an error when parsing that string.