You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, if an element implements MarshalJSON, jsoncolor will delegate the byte encoding to that method, and then use those returned bytes. Instead, we should allow the MarshalJSON method to return bytes, and then re-parse those into a v interface{}, which should then be passed to the usual jsoncolor funcs.
The text was updated successfully, but these errors were encountered:
The same issue affected handling of RawMessage. The PR does handles colorization of both (in practice, the encodeJSONMarshaler gets the JSON bytes and delegates to encodeRawMessage), but with the unfortunate side-effect that keys can be re-ordered in the output.
A preferable solution would be an implementation of encodeRawMessage that decodes the raw tokens and then re-encodes (with indent/color) without marshaling into a map at any time (as the map will lose the key order). This is beyond scope though.
Currently, if an element implements
MarshalJSON
,jsoncolor
will delegate the byte encoding to that method, and then use those returned bytes. Instead, we should allow theMarshalJSON
method to return bytes, and then re-parse those into av interface{}
, which should then be passed to the usualjsoncolor
funcs.The text was updated successfully, but these errors were encountered: