-
-
Notifications
You must be signed in to change notification settings - Fork 53
feat: deserialize single ComponentEvidence.identity
#900
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
Merged
jkowalleck
merged 4 commits into
CycloneDX:main
from
qkaiser:fix/component-evidence-identity-deserialization
Oct 22, 2025
Merged
feat: deserialize single ComponentEvidence.identity
#900
jkowalleck
merged 4 commits into
CycloneDX:main
from
qkaiser:fix/component-evidence-identity-deserialization
Oct 22, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…rialization The identity field in ComponentEvidence can be either a single object (dict) in CycloneDX 1.5 or a single object/array of objects in CycloneDX 1.6. The previous implementation failed when deserializing a single object format, throwing 'str' object has no attribute 'items' error. Added _IdentitySetSerializationHelper to properly handle both formats: - json_normalize: serializes Identity objects as list while preserving view context - json_deserialize: handles both dict (single) and list (array) formats Also updated _ComponentEvidenceSerializationHelper.json_denormalize to normalize single dict format to array before deserialization for consistency. Fixes deserialization of CycloneDX 1.5 and 1.6 SBOMs with component evidence. Signed-off-by: Quentin Kaiser <quentin.kaiser@onekey.com>
ComponentEvidence.identity
4 tasks
ComponentEvidence.identity
ComponentEvidence.identity
15 tasks
… into fix/component-evidence-identity-deserialization - remove JSON-only implemntations and tests - added more tests - streamlined some imeplementations Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
jkowalleck
reviewed
Oct 21, 2025
Altered the patch, and added new tests for deserialization. please review the chages, @qkaiser |
qkaiser
commented
Oct 21, 2025
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.
Modifications to the initial patch looks ok to me.
jkowalleck
approved these changes
Oct 22, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The identity field in ComponentEvidence can be either a single object (dict) in CycloneDX 1.5 or a single object/array of objects in CycloneDX 1.6. The previous implementation failed when deserializing a single object format, throwing
'str' object has no attribute 'items'
error.Added
_IdentitySetSerializationHelper
to properly handle both formats:Also updated
_ComponentEvidenceSerializationHelper.json_denormalize
to normalize single dict format to array before deserialization for consistency.Fixes deserialization of CycloneDX 1.5 and 1.6 SBOMs with component evidence.
The exact error being raised is the following:
Which gets triggered when calling
Bom.from_json()
containing entries like this one: