sbom-utility icon indicating copy to clipboard operation
sbom-utility copied to clipboard

Testcase: Need test for new complex "licenseChoice" schema defn.

Open mrutkows opened this issue 2 years ago • 1 comments

Need a testcase to validate the change of the "licenseChoice" schema defn.

Note: license "expression" is no longer a "string" type, but an "object" now with a "bom-ref".

    "licenseChoice": {
      "title": "License Choice",
      "description": "EITHER (list of SPDX licenses and/or named licenses) OR (tuple of one SPDX License Expression)",
      "type": "array",
      "oneOf": [
        {
          "title": "Multiple licenses",
          "description": "A list of SPDX licenses and/or named licenses.",
          "type": "array",
          "items": {
            "type": "object",
            "required": ["license"],
            "additionalProperties": false,
            "properties": {
              "license": {"$ref": "#/definitions/license"}
            }
          }
        },
        {
          "title": "SPDX License Expression",
          "description": "A tuple of exactly one SPDX License Expression.",
          "type": "array",
          "additionalItems": false,
          "minItems": 1,
          "maxItems": 1,
          "items": [{
            "type": "object",
            "additionalProperties": false,
            "required": ["expression"],
            "properties": {
              "expression": {
                "type": "string",
                "title": "SPDX License Expression",
                "examples": [
                  "Apache-2.0 AND (MIT OR GPL-2.0-only)",
                  "GPL-3.0-only WITH Classpath-exception-2.0"
                ]
              },
              "bom-ref": {
                "$ref": "#/definitions/refType",
                "title": "BOM Reference",
                "description": "An optional identifier which can be used to reference the license elsewhere in the BOM. Every bom-ref MUST be unique within the BOM."
              }
            }
          }]
        }
      ]
    },

mrutkows avatar Jul 26 '23 17:07 mrutkows

Please note all pre-existing tests of v1.5 "licenseChoice" struct changes all "PASS"

mrutkows avatar Jul 26 '23 17:07 mrutkows