Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
eac0ac6
Initial commit
stevespringett Jun 15, 2025
028c9df
Merge remote-tracking branch 'origin/master' into 2.0-dev
stevespringett Nov 11, 2025
bde33b2
Syncing with master
stevespringett Nov 11, 2025
dae213a
Revert "Syncing with master"
stevespringett Nov 11, 2025
fbaf3de
Added schema bundler and updated readme.
stevespringett Nov 11, 2025
0d74d96
Adding GitHub Action to combine schemas
stevespringett Nov 11, 2025
51fbf49
Updated branches
stevespringett Nov 11, 2025
b4721e1
Updating action
stevespringett Nov 12, 2025
91ec8e0
chore: update bundled schema [skip ci]
github-actions[bot] Nov 12, 2025
c4d6c82
Updated docgen for 2.0
stevespringett Nov 12, 2025
b6fed22
Added minified bundling
stevespringett Nov 12, 2025
173a276
chore: update bundled schemas [skip ci]
github-actions[bot] Nov 12, 2025
0427839
Added further optimization to minified version
stevespringett Nov 12, 2025
8668856
chore: update bundled schemas [skip ci]
github-actions[bot] Nov 12, 2025
c46624c
Fixed resolution issues
stevespringett Nov 24, 2025
ed3eb38
chore: update bundled schemas [skip ci]
github-actions[bot] Nov 24, 2025
7aceff4
Added ref verification
stevespringett Nov 24, 2025
70ea2fa
Merge remote-tracking branch 'origin/2.0-dev' into 2.0-dev
stevespringett Nov 24, 2025
dd45ceb
Updated JSON Schema for Humans
stevespringett Nov 25, 2025
b8abb0c
Initial commit of CycloneDX linter
stevespringett Nov 29, 2025
f0c447b
Moved bundler
stevespringett Nov 29, 2025
41ad354
Added lock file
stevespringett Nov 29, 2025
319ed73
Omitting a few properties from being bundled.
stevespringett Nov 30, 2025
47f0ec2
chore: update bundled schemas [skip ci]
github-actions[bot] Nov 30, 2025
f0fcf97
Added comment check
stevespringett Nov 30, 2025
625b757
Added schema version check
stevespringett Nov 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 59 additions & 0 deletions .github/workflows/bundle_2.0_schemas.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Bundle CycloneDX 2.0 JSON Schemas

on:
push:
branches:
- 2.0-dev
- 2.0-dev-threatmodeling
paths:
- 'schema/2.0/**/*.schema.json'
- 'tools/src/main/js/bundler/bundle-schemas.js'
workflow_dispatch: # Allows manual trigger

jobs:
bundle-schemas:
runs-on: ubuntu-latest

permissions:
contents: write # Required to push changes

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install dependencies
working-directory: tools/src/main/js/bundler
run: npm install

- name: Bundle schemas
working-directory: tools/src/main/js/bundler
run: |
node bundle-schemas.js \
../../../../../schema/2.0/model \
../../../../../schema/2.0/cyclonedx-2.0.schema.json

- name: Check for changes and commit
run: |
BUNDLED_FILE="schema/2.0/cyclonedx-2.0-bundled.schema.json"
MINIFIED_FILE="schema/2.0/cyclonedx-2.0-bundled.min.schema.json"

# Add both files (works for both new and modified files)
git add "$BUNDLED_FILE" "$MINIFIED_FILE"

# Check if there are staged changes
if git diff --staged --quiet; then
echo "No changes to bundled schemas"
else
echo "Committing bundled schema changes"
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git commit -m "chore: update bundled schemas [skip ci]"
git push
fi
13 changes: 9 additions & 4 deletions docgen/json/gen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -eu

declare -a CDX_VERSIONS=(
'2.0'
'1.7'
'1.6'
'1.5'
Expand Down Expand Up @@ -44,11 +45,15 @@ generate () {
local title="CycloneDX v${version} JSON Reference"
echo "Generating: $title"

local SCHEMA_FILE="$SCHEMA_PATH/bom-${version}.schema.json"
local STRICT_SCHEMA_FILE="$SCHEMA_PATH/bom-${version}-strict.schema.json"
if [ -f "$STRICT_SCHEMA_FILE" ]
then
local SCHEMA_FILE
if [[ "$version" == 1.* ]]; then
SCHEMA_FILE="$SCHEMA_PATH/bom-${version}.schema.json"
local STRICT_SCHEMA_FILE="$SCHEMA_PATH/bom-${version}-strict.schema.json"
if [ -f "$STRICT_SCHEMA_FILE" ]; then
SCHEMA_FILE="$STRICT_SCHEMA_FILE"
fi
else
SCHEMA_FILE="$SCHEMA_PATH/${version}/cyclonedx-${version}-bundled.schema.json"
fi
echo "SCHEMA_FILE: $SCHEMA_FILE"

Expand Down
2 changes: 1 addition & 1 deletion docgen/json/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
json-schema-for-humans==1.3.4
json-schema-for-humans==1.5.1
2 changes: 2 additions & 0 deletions docgen/json/templates/cyclonedx/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
v${version} (JSON)
</a>
<ul class="dropdown-menu" aria-labelledby="navbarScrollingDropdown">
<li><a class="dropdown-item" href="/docs/2.0/json/">v2.0 (JSON)</a></li>
<li><hr class="dropdown-divider"/></li>
<li><a class="dropdown-item" href="/docs/1.7/json/">v1.7 (JSON)</a></li>
<li><a class="dropdown-item" href="/docs/1.6/json/">v1.6 (JSON)</a></li>
<li><a class="dropdown-item" href="/docs/1.5/json/">v1.5 (JSON)</a></li>
Expand Down
12 changes: 6 additions & 6 deletions docgen/json/templates/cyclonedx/section_properties.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ <h2 class="mb-0">
</em>
{%- endif -%}
{%- if sub_property.is_required_property -%}
{{ " " }}<span class="badge required-property">Required</span>
{{ " " }}<span class="badge badge-warning required-property">Required</span>
{%- endif -%}
{%- if sub_property is deprecated -%}
{{ " " }}<span class="badge deprecated-property">Deprecated</span>
{%- if sub_property is deprecated or sub_property.kw_deprecated -%}
{{ " " }}<span class="badge badge-danger deprecated-property">Deprecated</span>
{%- endif -%}
{%- if sub_property.is_pattern_property -%}
{{ " " }}<span class="badge pattern-property">Pattern Property</span>
{{ " " }}<span class="badge badge-info pattern-property">Pattern Property</span>
{%- endif -%}
</button>
</h2>
Expand All @@ -35,7 +35,7 @@ <h2 class="mb-0">
<h2 class="handle">
<label>Pattern Property</label>
</h2>
<p>All property whose name matches the following regular expression must respect the following conditions</p>
<p>All properties whose name matches the following regular expression must respect the following conditions</p>
<span class="pattern-value">Property name regular expression: <code>{{ sub_property.property_name | escape }}</code></span>
<br/>
{%- endif -%}
Expand All @@ -52,4 +52,4 @@ <h2 class="handle">
</div>
</div>
</div>
</div>
</div>
2 changes: 2 additions & 0 deletions docgen/proto/templates/html.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,8 @@ https://github.com/pseudomuto/protoc-gen-doc/blob/master/resources/html.tmpl
v${version} (Protobuf)
</a>
<ul class="dropdown-menu" aria-labelledby="navbarScrollingDropdown">
<li><a class="dropdown-item" href="/docs/2.0/json/">v2.0 (JSON)</a></li>
<li><hr class="dropdown-divider"/></li>
<li><a class="dropdown-item" href="/docs/1.7/json/">v1.7 (JSON)</a></li>
<li><a class="dropdown-item" href="/docs/1.6/json/">v1.6 (JSON)</a></li>
<li><a class="dropdown-item" href="/docs/1.5/json/">v1.5 (JSON)</a></li>
Expand Down
2 changes: 2 additions & 0 deletions docgen/xml/xs3p.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@
<li class="dropdown">
<a href="#" class="dropdown-toggle version-selector" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">v<xsl:value-of select="$cycloneDxVersion"/> (XML)<span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a class="dropdown-item" href="/docs/2.0/json/">v2.0 (JSON)</a></li>
<li style="padding:0"><hr class="dropdown-divider"/></li>
<li><a class="dropdown-item" href="/docs/1.7/json/">v1.7 (JSON)</a></li>
<li><a class="dropdown-item" href="/docs/1.6/json/">v1.6 (JSON)</a></li>
<li><a class="dropdown-item" href="/docs/1.5/json/">v1.5 (JSON)</a></li>
Expand Down
37 changes: 37 additions & 0 deletions schema/2.0/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# CycloneDX 2.0 Schemas

This directory contains the official JSON Schema definitions for CycloneDX 2.0, as standardised in
[ECMA-424](https://ecma-international.org/publications-and-standards/standards/ecma-424/).
These schemas constitute the normative implementation of the CycloneDX specification and are intended for use in
validation, tooling, and data exchange.

## Schema Overview

| File | Description |
|--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [`cyclonedx-2.0.schema.json`](./cyclonedx-2.0.schema.json) | The normative schema for CycloneDX Bill of Materials (BOM) documents. This schema references modular models and defines the complete structure for expressing inventories and metadata. |
| [`cyclonedx-2.0-bundled.schema.json`](./cyclonedx-2.0-bundled.schema.json) | A fully resolved version of the BOM schema with all external model references inlined. Useful for systems that require a self-contained schema. |
| [`cyclonedx-api-2.0.schema.json`](./cyclonedx-api-2.0.schema.json) | The normative API-focused schema. It reuses CycloneDX models but is structured for compatibility with request/response patterns in service architectures. |
| [`cyclonedx-api-2.0-bundled.schema.json`](./cyclonedx-api-2.0-bundled.schema.json) | The combined version of the API schema with all model definitions embedded. Suitable for use in tools or validators that do not support `$ref` resolution. |

## Modularity and Model Composition

CycloneDX 2.0 is defined as a modular specification. All core concepts—such as components, services, vulnerabilities,
licensing, and AI/ML metadata, are encapsulated in reusable model definitions located in the [`model/`](./model) directory.

This modular architecture promotes:

- **Consistency** across multiple schema contexts
- **Reusability** of models within and beyond CycloneDX
- **Clarity and maintainability** for implementers

## Bundled Schemas

The `*-bundled` schema files are auto-generated from the normative schemas by resolving all references.
These are provided for convenience and do not supersede the authoritative pre-defined schemas.

## Related Resources

- CycloneDX Website: [https://cyclonedx.org](https://cyclonedx.org)
- ECMA-424 Publication: [https://ecma-international.org/publications-and-standards/standards/ecma-424/](https://ecma-international.org/publications-and-standards/standards/ecma-424/)
- Model Definitions: See [`model/README.md`](./model/README.md)
1 change: 1 addition & 0 deletions schema/2.0/cyclonedx-2.0-bundled.min.schema.json

Large diffs are not rendered by default.

Loading