JSON marshal Escape #1127
Labels
bug/1-unconfirmed
Bug should have enough information for reproduction, but confirmation has not happened yet.
kind/bug
A reported bug.
Is there a particular reason for using fmt
%q
to return the inner Raw Json struct for a JSON type field?I've found that when I try to marshal a generated data type with a JSON field, I get results like this:
Where
data.data
is of type JSON, it is escaping the quotes (treating it as a string) rather than printing the JSON object. This adds an extra step of processing at the end to have a generic JSON viewer display this correctly.When MarshalJSON is replaced with a copy of the built-in functionality, it is written as expected.
Result:
The text was updated successfully, but these errors were encountered: