Skip to content

TaskType enum fails to deserialize lowercase "lint" value defined by CycloneDX 1.6 schema #819

@Theerthamanoj

Description

@Theerthamanoj

When parsing a CycloneDX 1.6 JSON BOM that contains a formulation[].workflows[].taskTypes array with the value "lint" (as defined by the official spec), JsonParser.parse(...) throws an InvalidFormatException. The library expects "LINT" (uppercase) — a case mismatch that violates the official CycloneDX 1.6 JSON schema.

Library version :- org.cyclonedx:cyclonedx-core-java:12.1.0

As per the official CycloneDX 1.6 JSON schema (https://github.com/CycloneDX/cyclonedx-core-java/blob/cyclonedx-core-java-12.1.0/src/main/resources/bom-1.6.schema.json), the taskType definition declares lowercase enum values:

Expected behavior


"taskType": {
"type": "string",
"enum": [
"copy", "clone", "lint", "scan", "merge", "build",
"test", "deliver", "deploy", "release", "clean", "other"
]
}
Therefore, a BOM containing "taskTypes": ["lint", "scan", "deploy", "test"] should parse successfully.

Actual behavior

JsonParser.parse(...) throws:
com.fasterxml.jackson.databind.exc.InvalidFormatException:
Cannot deserialize value of type org.cyclonedx.model.formulation.FormulationCommon$TaskType
from String "lint": not one of the values accepted for Enum class:
[other, test, LINT, deliver, release, merge, clean, clone, build, copy, deploy, scan]

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