Skip to content

New BOM with Spec Version#266

Open
attiasas wants to merge 1 commit into
CycloneDX:masterfrom
attiasas:new_bom_with_spec
Open

New BOM with Spec Version#266
attiasas wants to merge 1 commit into
CycloneDX:masterfrom
attiasas:new_bom_with_spec

Conversation

@attiasas
Copy link
Copy Markdown

@attiasas attiasas commented Jun 1, 2026

feat: add NewBOMWithSpecVersion for configurable BOM spec version

Summary

Adds NewBOMWithSpecVersion(specVersion SpecVersion) so callers can create a BOM with the correct JSON schema, XML namespace, and specVersion for any supported CycloneDX spec. NewBOM() is unchanged in behavior and still defaults to CycloneDX 1.7 by delegating to the new helper.

Changes

  • Add NewBOMWithSpecVersion(specVersion SpecVersion) *BOM in cyclonedx.go
  • Refactor NewBOM() to call NewBOMWithSpecVersion(SpecVersion1_7) instead of inlining field initialization
  • Initialize JSONSchema, XMLNS, and SpecVersion from the specVersion argument via existing jsonSchemas / xmlNamespaces maps

Notes

  • Non-breaking: NewBOM() behavior is preserved

@attiasas attiasas requested a review from a team as a code owner June 1, 2026 06:45
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented Jun 1, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

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.

Signed-off-by: attiasas <assafattias93@gmail.com>
@attiasas attiasas force-pushed the new_bom_with_spec branch from 6dae744 to 87d3536 Compare June 1, 2026 06:58
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.

1 participant