Skip to content

CycloneDX output metadata.properties set to null instead of empty array or omitted. #1759

@Cerebus

Description

@Cerebus

What happened:

> grype -o cyclonedx-json python:3.12.2-slim > test-grype.json
> check-jsonschema --schemafile ./schema/bom-1.5.schema.json test-grype.json
Schema validation errors were encountered.
  test-grype.json::$.metadata.properties: None is not of type 'array'

What you expected to happen:
It should validate. E.g., after replacing metadata.properties: null with []:

> check-jsonschema --schemafile ./schema/bom-1.5.schema.json test-grype.json
ok -- validation done

How to reproduce it (as minimally and precisely as possible):

See above.

Anything else we need to know?:

Environment:
Application: grype
Version: 0.74.7
BuildDate: 2024-02-26T17:30:31Z
GitCommit: brew
GitDescription: [not provided]
Platform: darwin/amd64
GoVersion: go1.22.0
Compiler: gc
Syft Version: v0.105.1
Supported DB Schema: 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood-first-issueGood for newcomers

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions