RawJSON doesn't trim newline
If you're adding a json response that was written using json.NewEncoder(w).Encode(..), there's a trailing newline (by design).
The newline is then left un-escaped in the log entry if you use RawJSON to attach it.
Could zerolog trim the content from newlines for us?
RawJSON does not make any check, the caller is responsible for sending the right input.
The thing is, isn't that technically a valid json response?
Edit: just saw you've documented this on the function, fair enough.
Not in this context. Basically this method gives you the freedom to add some raw bytes. You are responsible for making the final output valid.
Yes, this is the issue of Encode adding newlines which is different from json.Marshal.