Skip to content

[cyclonedx-bom] top-level bom.version should be optional in Bom struct #785

@weihanglo

Description

@weihanglo

Since CycloneDX v1.5, the bom.version field is marked as optional in the JSON schema . The truth is in XML and protobuf specification it has been optional way earlier than 1.4, but JSON schema failed to catch up until v1.5 (seethe relevant PR CycloneDX/specification#260 and CycloneDX/specification#78).

Since bom.version always has a default value, it should be safe we just make it optional

Alternatively, if we want to follow the v1.3 and v1.4 JSON schema strictly (which I believe it was a bug fixed in v1.5), we could diverge the deserialization based on spec versions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions