Skip to content

Conversation

@mr-zepol
Copy link
Contributor

Introduces VulnerabilitySerializer for version-aware serialization of Vulnerability objects in both JSON and XML formats. Updates AbstractBomGenerator to register the new serializer, modifies Vulnerability model to ignore deprecated tool fields, and adds tests for vulnerability parsing in BomJsonGeneratorTest and BomXmlGeneratorTest for schema versions 1.4 and 1.5.

Introduces VulnerabilitySerializer for version-aware serialization of Vulnerability objects in both JSON and XML formats. Updates AbstractBomGenerator to register the new serializer, modifies Vulnerability model to ignore deprecated tool fields, and adds tests for vulnerability parsing in BomJsonGeneratorTest and BomXmlGeneratorTest for schema versions 1.4 and 1.5.
@mr-zepol mr-zepol requested a review from a team as a code owner November 11, 2025 20:47
@codacy-production
Copy link

codacy-production bot commented Nov 11, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 43922d01 99.38%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (43922d0) Report Missing Report Missing Report Missing
Head commit (f143a85) 6614 5009 75.73%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#743) 160 159 99.38%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

Introduces new unit tests for vulnerability parsing in both JSON and XML formats for version 16, and refactors existing test method names for clarity. Ensures coverage for versions 14, 15, and 16 using both JSON and XML BOM inputs.
Updates VulnerabilitySerializer to avoid serializing empty string fields and to convert deprecated Tool objects to Component objects for CycloneDX versions 1.5 and above. Adds comprehensive tests to verify correct serialization behavior for empty strings and tool conversion across JSON and XML formats and multiple schema versions.
Simplifies tool serialization by removing conversion of deprecated tools to components for v1.5+; now preserves deprecated tool format if ToolInformation is not present. Updates and renames related tests to verify correct preservation of deprecated tool format and improves test coverage for edge cases.
@mr-zepol mr-zepol requested a review from nscuro November 11, 2025 22:37
Introduces StringUtils.isNotEmpty checks before setting Vulnerability and Analysis fields to prevent assigning empty strings. This improves robustness when deserializing JSON with missing or empty values.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants