Skip to content
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

fix: change Component.Evidence.Identity to array #204

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

DmitriyLewen
Copy link

Description

in CycloneDX 1.6 type of Component.Evidence.Identity has been changed to []Identity.
Identity as struct was marked as deprecated.
https://cyclonedx.org/docs/1.6/json/#tab-pane_metadata_component_evidence_identity_oneOf_i0

Related issues

Signed-off-by: DmitriyLewen <[email protected]>
Comment on lines +198 to +204
// Spec version 1.5 uses only one Identity.
// cf. https://cyclonedx.org/docs/1.5/json/#components_items_evidence_identity
if c.Evidence.Identity != nil {
ids := *c.Evidence.Identity
ids = ids[:1]
c.Evidence.Identity = &ids
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure about this way...
Maybe we need to select one Identifier using Field with some order

Please tell me if you have a better solution.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I overwrite all the Evidence fields in the MarshalXML and UnmarshalXML functions, so I added test cases for each field.

Tell me if this is too much

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.

Improve support for the Component.Evidence.Identity field in CycloneDX 1.6
1 participant