Skip to content

feat: add support for Component data and modelParameters.datasets - #1083

Open
wiebe-vandendriessche wants to merge 1 commit into
CycloneDX:mainfrom
wiebe-vandendriessche:feat/data
Open

wiebe-vandendriessche wants to merge 1 commit into
CycloneDX:mainfrom
wiebe-vandendriessche:feat/data

Conversation

@wiebe-vandendriessche

Copy link
Copy Markdown
Contributor

Description

Adds the CycloneDX componentData type (1.5+) and connects it to Component.data and ModelParameters.datasets. Until now ModelParameters(datasets=...) raised NotImplementedError (#913) and Component.data was a TODO.

  • New module cyclonedx.model.data with ComponentData, ComponentDataKind, DataContents, DataGovernance, DataGovernanceResponsibleParty and DatasetReference (a bom-ref or a BOM-Link).
  • Component.data and ModelParameters.datasets, which accepts inline ComponentData and DatasetReference entries.
  • Graphic and GraphicsCollection moved to cyclonedx.model.graphics to avoid a circular import. They are still importable from cyclonedx.model.model_card.
  • DataGovernanceResponsibleParty requires exactly one of organization or contact, and DatasetReference rejects an empty ref. Both follow the schemas, as the JSON oneOf and refType minLength=1 otherwise let invalid output through.
  • Graphic.name and GraphicsCollection.description no longer use NORMALIZED_STRING. The schema types them as xs:string, and XML lost newlines that JSON kept.

Known limitations, not changed here: the XML schema of 1.5 allows only one component/data element (JSON 1.5 allows many), a spec defect fixed for 1.6.1+ in specification#518, so several entries give invalid XML 1.5. BomRefDiscriminator does not cover ComponentData bom-refs, which I plan to fix separately for all missing bom-refs.

Tests: unit tests for all new classes, plus two new fixtures and enum tests with 18 new snapshots (1.5 to 1.7, JSON and XML). No existing snapshot changed.

Resolves or fixes issue: #913

AI Tool Disclosure

  • My contribution does not include any AI-generated content
  • My contribution includes AI-generated content, as disclosed below:
    • AI Tools: Claude Code
    • LLMs and versions: Claude Sonnet 5.5
    • Prompts: General instructions to plan, implement, test and schema-check the feature. All output was reviewed and run by me and I take full responsibility.

Affirmation

Signed-off-by: Wiebe Vandendriessche <wiebe.vandendriessche@gmail.com>
@wiebe-vandendriessche
wiebe-vandendriessche requested a review from a team as a code owner November 26, 2026 14:14
@read-the-docs-community

Copy link
Copy Markdown

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 147 complexity · 12 duplication

Metric Results
Complexity 147
Duplication 12

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@jkowalleck jkowalleck linked an issue Nov 26, 2026 that may be closed by this pull request
@jkowalleck jkowalleck added enhancement New feature or request schema 1.5 labels Nov 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request schema 1.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add support for Component data field

2 participants