-
-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add missing provides mapping to Dependency to comply with CycloneDX 1.6 spec #599
base: master
Are you sure you want to change the base?
Conversation
c05258b
to
d42bf3b
Compare
d42bf3b
to
62a4ffc
Compare
@@ -60,6 +66,26 @@ public void addDependency(final Dependency dependency) { | |||
} | |||
} | |||
|
|||
@VersionFilter(Version.VERSION_16) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version filter is only needed at the attribute level
@VersionFilter(Version.VERSION_16) | ||
@JsonProperty("provides") | ||
@JacksonXmlProperty(localName = "provides") | ||
private List<Dependency> provides; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be private List<BomReference> provides
the provide is linked to a BomRef not to a dependency based on the spec
@@ -97,6 +97,13 @@ private void writeJSONDependenciesWithGenerator(final JsonGenerator generator, f | |||
} | |||
} | |||
generator.writeEndArray(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests for both Generators and Parses should be included (for XML and JSON)
@@ -97,6 +97,13 @@ private void writeJSONDependenciesWithGenerator(final JsonGenerator generator, f | |||
} | |||
} | |||
generator.writeEndArray(); | |||
if (CollectionUtils.isNotEmpty(dependency.getProvides())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this works, better to check with the generator test to confirm
…neDX 1.6 spec Signed-off-by: Andrea Vibelli <[email protected]>
Signed-off-by: Andrea Vibelli <[email protected]>
a358c91
to
4e13d3a
Compare
@mr-zepol Hi, apologies for the very late reply, pushed some fixes after your review, thanks! |
Following #565, this PR attempts to add the missing mapping to comply with the CycloneDX 1.6 spec for the "provides" field inside the Dependency object: https://cyclonedx.org/docs/1.6/json/#dependencies_items_provides.