Hello,
How to treat an embedded json string as it, and not to escape it during json marshal.
this code explains what I am trying to do (this example is not working after I change to use a struct).
I have one field(r), which I am setting a json string. I marshal it as
j, err := json.Marshal(map[string]interface{}{
"message": r.m,
"reply": r.r,
})
At client, I get all the " escaped as \" shown in the first sample.
{"message":null,"reply":"{\"6\":[{\"Id\":7,\"Org
{"message":null,"reply":[{"Id":2,
But, if I directly encode the object, I get the response as in second sample. I can make it to work at the client by parsing it in JS.
JSON.parse(response)
Do you think it is more efficient to pass the un-escaped string. Is it possible?