We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I (trying) to create an API that responds with "IndentedJSON". The struct is like
type Mydata struct { Name string Location string Data interface{} Other string }
The 'Data' field has JSON. When I use "IndentedJSON" I see the "outer" JSON cleanly rendered, but the inner JSON is escaped. EX:
{ "Name": "Vijay", "Location": "Loca1", "Data": "{\"ids\":[\"AA\",\"BB\"]}", "Other": "" }
Is there an way to fix this? and print the "clean" JSON (unescaped JSON)
The text was updated successfully, but these errors were encountered:
Try this definition
type Mydata struct { Name string Location string Data json.RawMessage Other string }
Sorry, something went wrong.
No branches or pull requests
I (trying) to create an API that responds with "IndentedJSON". The struct is like
The 'Data' field has JSON. When I use "IndentedJSON" I see the "outer" JSON cleanly rendered, but the inner JSON is escaped.
EX:
Is there an way to fix this? and print the "clean" JSON (unescaped JSON)
The text was updated successfully, but these errors were encountered: