Skip to content

[2.0] fixes on schema and test resources - #1001

Open
jkowalleck wants to merge 38 commits into
2.0-devfrom
2.0-tests-init-fixes
Open

[2.0] fixes on schema and test resources#1001
jkowalleck wants to merge 38 commits into
2.0-devfrom
2.0-tests-init-fixes

Conversation

@jkowalleck

@jkowalleck jkowalleck commented Aug 4, 2026

Copy link
Copy Markdown
Member

fixes or related to

besides those fixes above, this is in the PR:

  • made the refLinkType inherit explicit
  • fixes the array nesting of extensibleProerties
  • consolidated milisecond timestamp for JSS
  • adds $comments
  • enhanced some docs
  • added test cases
    • for extensibleProperties
  • fixed valid test data
    • all test data that was just carried over from CDX 1.x was transferred to CDX 2.0schema
  • fixed invalid test data
    • removed invalid-component-choice-missing-name-2.0.json - as the name was optional or did not exist.
      ❓ was this intentional/correct

tests for the things are based on:

@jkowalleck jkowalleck mentioned this pull request Aug 4, 2026
4 tasks
@jkowalleck jkowalleck changed the title 2.0 tests init fixes 2.0 fixes Aug 4, 2026
@jkowalleck jkowalleck added defect CDX 2.0 related to release v2.0 labels Aug 4, 2026
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck
jkowalleck force-pushed the 2.0-tests-init-fixes branch from a03e560 to 905e58a Compare August 4, 2026 15:36
jkowalleck added a commit that referenced this pull request Aug 4, 2026
- [x] Java tests - functional
- [x] JS tests - functional - WIP
- found some false-positives/false-negatives - due to errors in test
resources
- [x] JS tests - schema validate
  - includes #996
  - includes #992
- JS tests - semantics
  - [x] #998
  - [x] #995
- [x] PHP tests - functional

added tests only,
no schema/res fixes - they are prepared in 
- #997 
- #1001

---------

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
jkowalleck and others added 23 commits August 4, 2026 19:00
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck jkowalleck added the chore: QA A chore related to Quality Assurance label Aug 5, 2026
@jkowalleck jkowalleck added this to the 2.0 milestone Aug 5, 2026
@jkowalleck
jkowalleck marked this pull request as ready for review August 5, 2026 17:45
@jkowalleck
jkowalleck requested a review from a team as a code owner August 5, 2026 17:45

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added new test file

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

added new test file

"$ref": "#/$defs/timestamp/$defs/withMilliseconds",
"title": "Created Timestamp",
"description": "The time at which this signature was originally created. The creator can use any time it deems most appropriate as the time the signature was created, but it MUST be precise to the nearest millisecond (exactly three digits after the decimal place in seconds). The created property MUST NOT be changed when creating a new version of the signature.",
"$comment": "Normative source: ITU-T X.590 clause 6.3.1",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

consolidated to #/$defs/timestamp/$defs/withMilliseconds

"title": "Modified Timestamp",
"description": "The time that this particular version of the signature was last modified. The creator can use any time it deems most appropriate as the time that this version of the signature was modified, but it MUST be precise to the nearest millisecond (exactly three digits after the decimal place in seconds). The modified property MUST be later than or equal to the value of the created property. If the created and modified properties are the same, then this is the first version of the signature.",
"$comment": "Normative source: ITU-T X.590 clause 6.3.1. Cross-field invariant: 'modified' MUST be greater than or equal to 'created'. JSON Schema 2020-12 cannot compare two sibling property values, so this constraint is NOT enforced by this schema and MUST be validated by the consuming tool or conformance suite.",
"pattern": "^[0-9]{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12][0-9]|3[01])T(?:[01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\\.[0-9]{3}Z$"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

consolidated to #/$defs/timestamp/$defs/withMilliseconds

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

file was removed, since the relevant test case did not exist.
the componentCHoice does not require/have a name

❓ was this intentional/correct

Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
@jkowalleck
jkowalleck requested review from stevespringett and a lite review from Copilot August 5, 2026 18:48
@jkowalleck jkowalleck changed the title 2.0 fixes 2.0 fixes on schema and test resources Aug 5, 2026
@jkowalleck jkowalleck changed the title 2.0 fixes on schema and test resources [2.0] fixes on schema and test resources Aug 5, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Updates the CycloneDX 2.0 JSON schemas and test fixtures to align with recent model changes (notably parties, signatures, extensible properties, and stricter schema semantics), and extends the JS semantic test suite to enforce additional schema invariants.

Changes:

  • Refactors many 2.0 test resources from legacy fields (e.g., publisher, supplier, manufacturer, authors, signature) to 2.0 structures (parties, signatures), and corrects cryptography-related shapes.
  • Tightens/clarifies schema semantics (e.g., additionalProperties: false in more places, explicit property presence in oneOf/anyOf branches, refLinkType usage).
  • Adds extensible-properties valid/invalid fixtures and adjusts JS semantic tests for the updated schema patterns.

Reviewed changes

Copilot reviewed 49 out of 49 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/src/test/resources/2.0/valid-standard-2.0.json Updates signature fixture to signatures[] and new JSS field names.
tools/src/test/resources/2.0/valid-service-2.0.json Migrates publisher to parties role-based representation.
tools/src/test/resources/2.0/valid-perspective-2.0.json Migrates supplier to parties role-based representation.
tools/src/test/resources/2.0/valid-patent-2.0.json Migrates manufacturer to parties and updates organization URL structure.
tools/src/test/resources/2.0/valid-machine-learning-considerations-env-2.0.json Migrates supplier/publisher to parties.
tools/src/test/resources/2.0/valid-machine-learning-2.0.json Migrates publisher to parties.
tools/src/test/resources/2.0/valid-license-name-with-text-2.0.json Migrates publisher to parties.
tools/src/test/resources/2.0/valid-license-name-with-licensing-2.0.json Migrates publisher to parties.
tools/src/test/resources/2.0/valid-license-name-2.0.json Migrates publisher to parties.
tools/src/test/resources/2.0/valid-license-id-with-text-2.0.json Migrates publisher to parties.
tools/src/test/resources/2.0/valid-license-id-2.0.json Migrates publisher to parties.
tools/src/test/resources/2.0/valid-license-expression-with-licensing-2.0.json Migrates publisher to parties.
tools/src/test/resources/2.0/valid-license-expression-2.0.json Migrates publisher to parties.
tools/src/test/resources/2.0/valid-license-choice-2.0.json Migrates publisher to parties.
tools/src/test/resources/2.0/valid-formulation-2.0.json Migrates publisher to parties.
tools/src/test/resources/2.0/valid-external-reference-2.0.json Migrates publisher to parties and adds new externalReference types.
tools/src/test/resources/2.0/valid-extensible-properties.json Adds a valid extensible-properties fixture (new file).
tools/src/test/resources/2.0/valid-cryptography-implementation-2.0.json Updates cryptography fixtures to match schema (e.g., arrays where required).
tools/src/test/resources/2.0/valid-cryptography-full-2.0.json Updates cryptography fixtures (e.g., arrays for refs/platform).
tools/src/test/resources/2.0/valid-cryptography-certificate-advanced-2.0.json Updates certificate fixtures and adds algorithm asset + algorithmRef arrays.
tools/src/test/resources/2.0/valid-cryptography-certificate-2.0.json Fixes ref and expands crypto assets; updates platform arrays.
tools/src/test/resources/2.0/valid-component-swid-full-2.0.json Migrates authors to parties with author role.
tools/src/test/resources/2.0/valid-component-swid-2.0.json Migrates authors to parties with author role.
tools/src/test/resources/2.0/valid-component-choice-xor-2.0.json Migrates supplier to parties for component-choice samples.
tools/src/test/resources/2.0/valid-component-choice-or-2.0.json Migrates supplier to parties for component-choice samples.
tools/src/test/resources/2.0/valid-component-choice-nested-2.0.json Migrates nested supplier to nested parties.
tools/src/test/resources/2.0/valid-component-choice-in-nested-components-2.0.json Migrates nested supplier to nested parties.
tools/src/test/resources/2.0/valid-component-choice-and-2.0.json Migrates supplier to parties for AND operator sample.
tools/src/test/resources/2.0/valid-bom-2.0.json Broad migration of manufacturer/supplier/authors/publisher to parties, including contacts and URLs.
tools/src/test/resources/2.0/valid-attestation-2.0.json Migrates multiple signature objects to signatures[] throughout.
tools/src/test/resources/2.0/invalid-extensible-properties.json Adds invalid extensible-properties fixture (new file).
tools/src/test/resources/2.0/invalid-component-choice-missing-name-2.0.json Removes an invalid test resource fixture.
tools/src/test/js/schema-v2/json-schema-semantic-tests.js Updates semantic tests for refLinkType exception and additionalProperties handling.
schema/2.0/model/cyclonedx-vulnerability-2.0.schema.json Adds additionalProperties: false and fixes required-property existence assertions.
schema/2.0/model/cyclonedx-patent-2.0.schema.json Switches certain refs from refType to refLinkType.
schema/2.0/model/cyclonedx-party-2.0.schema.json Makes oneOf branches explicitly assert the required property exists.
schema/2.0/model/cyclonedx-metadata-2.0.schema.json Adds additionalProperties: false to an object schema.
schema/2.0/model/cyclonedx-license-2.0.schema.json Makes oneOf branches explicitly assert the required property exists.
schema/2.0/model/cyclonedx-jss_X590_2023_10-2.0.schema.json Consolidates millisecond timestamp handling and adds explicit property presence in anyOf.
schema/2.0/model/cyclonedx-formulation-2.0.schema.json Makes oneOf branches explicitly assert the required property exists.
schema/2.0/model/cyclonedx-declaration-2.0.schema.json Adjusts required fields in a oneOf branch (e.g., signatures).
schema/2.0/model/cyclonedx-data-2.0.schema.json Makes oneOf branches explicitly assert the required property exists.
schema/2.0/model/cyclonedx-cryptography-2.0.schema.json Refactors some oneOf branches/types and shifts refs to refLinkType.
schema/2.0/model/cyclonedx-component-2.0.schema.json Improves mutual-exclusion logic annotation and adds property presence to not.
schema/2.0/model/cyclonedx-common-2.0.schema.json Makes refLinkType inheritance explicit; refactors extensible-properties schema; adjusts base mixins; adds placeholder for organizationalEntityOrContact.
schema/2.0/model/cyclonedx-citation-2.0.schema.json Makes anyOf/oneOf branches explicitly assert required property exists.
schema/2.0/model/cyclonedx-annotation-2.0.schema.json Makes oneOf branches explicitly assert required property exists.
schema/2.0/model/cyclonedx-ai-modelcard-2.0.schema.json Removes redundant type alongside $ref.
schema/2.0/cyclonedx-2.0.schema.json Replaces root additionalProperties: false with unevaluatedProperties: false to support extensibility mixins.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread schema/2.0/model/cyclonedx-common-2.0.schema.json
Comment thread tools/src/test/js/schema-v2/json-schema-semantic-tests.js
Comment thread schema/2.0/model/cyclonedx-component-2.0.schema.json Outdated
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CDX 2.0 related to release v2.0 chore: QA A chore related to Quality Assurance defect

Projects

None yet

2 participants