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
If I serialize a org.cyclonedx.model.Bom to JSON using BomJsonGenerator.toJsonString() then I unexpectedly lose newlines in various strings, like license and copyright text where new lines are especially important.
I tracked down the problem to org.cyclonedx.util.serializer.TrimStringSerializer. This serializer is not just trimming but is also replacing carriage return, line feed, and tab characters with a space. These should be preserved in the JSON. Jackson will correctly escape such characters, like encoding newlines as '\n'.
In contrast, BomXmlGenerator is fine. The XML version has newlines correctly preserved in the XML.
I am currently working around the issue as follows:
If I serialize a org.cyclonedx.model.Bom to JSON using BomJsonGenerator.toJsonString() then I unexpectedly lose newlines in various strings, like license and copyright text where new lines are especially important.
I tracked down the problem to org.cyclonedx.util.serializer.TrimStringSerializer. This serializer is not just trimming but is also replacing carriage return, line feed, and tab characters with a space. These should be preserved in the JSON. Jackson will correctly escape such characters, like encoding newlines as '\n'.
In contrast, BomXmlGenerator is fine. The XML version has newlines correctly preserved in the XML.
I am currently working around the issue as follows:
The text was updated successfully, but these errors were encountered: