Skip to content

feat: Support properties on license#1383

Open
peschuster wants to merge 1 commit intoCycloneDX:mainfrom
peschuster:feat/property-support-for-license
Open

feat: Support properties on license#1383
peschuster wants to merge 1 commit intoCycloneDX:mainfrom
peschuster:feat/property-support-for-license

Conversation

@peschuster
Copy link

Description

Adds support for "properties" on named and spdx licenses available with since schema version 1.5

AI Tool Disclosure

  • My contribution does not include any AI-generated content

Affirmation

@peschuster peschuster requested a review from a team as a code owner February 20, 2026 17:23
@jkowalleck jkowalleck self-requested a review February 23, 2026 13:15
Copy link
Member

@jkowalleck jkowalleck left a comment

Choose a reason for hiding this comment

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

Thank you for working on this feature.
See my remarks below

supportsMetadataProperties: boolean
supportsExternalReferenceHashes: boolean
supportsLicenseAcknowledgement: boolean
supportsLicenseProperties: boolean
Copy link
Member

Choose a reason for hiding this comment

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

please, dont add a new property supportsLicenseProperties for this.
instead, alter the existing function supportsProperties() accordingly. something like

  supportsProperties (model: any): boolean {
    switch (true) {
      case model instanceof NamedLicense || model instanceof SpdxLicense:
        return this.#supportsLicenseProperties 
      default:
        return this.#supportsProperties
    }
  }

the idea is: we dont have a public spec.supportsSomethingProperties for each and every thing. instead, we have the method spec.supportsProperties(someDataModel)

supportsMetadataProperties: boolean,
supportsExternalReferenceHashes: boolean,
supportsLicenseAcknowledgement: boolean,
supportsLicenseProperties: boolean,
Copy link
Member

Choose a reason for hiding this comment

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

move the new argument at the bottom,
or move it behind the supportsProperties

url: JsonSchema.isIriReference(url)
? url
: undefined,
properties: spec.supportsProperties(data) && spec.supportsLicenseProperties && data.properties.size > 0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
properties: spec.supportsProperties(data) && spec.supportsLicenseProperties && data.properties.size > 0
properties: data.properties.size > 0 && spec.supportsProperties(data)

const url = escapeUri(data.url?.toString())
const spec = this._factory.spec
const url = escapeUri(data.url?.toString())
const properties: SimpleXml.Element | undefined = spec.supportsProperties(data) && spec.supportsLicenseProperties && data.properties.size > 0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const properties: SimpleXml.Element | undefined = spec.supportsProperties(data) && spec.supportsLicenseProperties && data.properties.size > 0
const properties: SimpleXml.Element | undefined = data.properties.size > 0 && spec.supportsProperties(data)

const url = escapeUri(data.url?.toString())
const spec = this._factory.spec
const url = escapeUri(data.url?.toString())
const properties: SimpleXml.Element | undefined = spec.supportsProperties(data) && spec.supportsLicenseProperties && data.properties.size > 0
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const properties: SimpleXml.Element | undefined = spec.supportsProperties(data) && spec.supportsLicenseProperties && data.properties.size > 0
const properties: SimpleXml.Element | undefined = data.properties.size > 0 && spec.supportsProperties(data)

@jkowalleck jkowalleck added enhancement New feature or request schema 1.5 related to CycloneDX spec v1.5 labels Feb 23, 2026
Signed-off-by: Peter Schuster <p.schuster@pilz.de>
@peschuster peschuster force-pushed the feat/property-support-for-license branch from 4cef7ee to 2bb7604 Compare February 23, 2026 14:40
@peschuster
Copy link
Author

Thanks for the review and feedback.

The new version of the diff should address all comments and requests for changes.

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 related to CycloneDX spec v1.5

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants