Package-URL test definition

Type: object

Schema for Package-URL building and parsing tests with input and expected output.

No Additional Properties

JSON schema

Type: objectFormat: uri

Contains the URL of the JSON schema for Package-URL tests.

Test suite

Type: array

A list of Package-URL build and parse tests.

Must contain a minimum of 1 items

All items must be unique

No Additional Items

Each item of this array must be:

PURL test

Type: object

A PURL test with input and expected output.

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "parse"

Type: const
Specific value: false
Type: object

Input test PURL

Type: string

A PURL string to use as a test input (canonical or not).

Expected output decoded PURL components

Type: object

Test output as an object decoded PURL components, unless expected_failure.

No Additional Properties

PURL type

Type: string or null Default: null

Package-URL type component.

PURL namespace

Type: string or null Default: null

Package-URL namespace decoded component.

PURL name

Type: string or null Default: null

Package-URL name decoded component.

PURL version

Type: string or null Default: null

Package-URL version decoded component.

PURL qualifiers

Type: object or null Default: null

Package-URL qualifiers decoded component as an object.

PURL subpath

Type: string or null Default: null

Package-URL subpath decoded component.

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "build"

Type: const
Specific value: false
Type: object

Expected output decoded PURL components

Type: object

Test output as an object decoded PURL components, unless expected_failure.

No Additional Properties

PURL type

Type: string or null Default: null

Package-URL type component.

PURL namespace

Type: string or null Default: null

Package-URL namespace decoded component.

PURL name

Type: string or null Default: null

Package-URL name decoded component.

PURL version

Type: string or null Default: null

Package-URL version decoded component.

PURL qualifiers

Type: object or null Default: null

Package-URL qualifiers decoded component as an object.

PURL subpath

Type: string or null Default: null

Package-URL subpath decoded component.

Expected canonical PURL

Type: string

A canonical PURL string to use as a test ouput.

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "roundtrip"
Type: object

Input test PURL

Type: string

A PURL string to use as a test input (canonical or not).

Expected canonical PURL

Type: string

A canonical PURL string to use as a test ouput.

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "parse"

Type: const
Specific value: true
Type: object

The following properties are required:

  • expected_failure_reason

Input test PURL

Type: string

A PURL string to use as a test input (canonical or not).

Type: object

If the conditions in the "If" tab are respected, then the conditions in the "Then" tab should be respected. Otherwise, the conditions in the "Else" tab should be respected.

Type: object

Type: const
Specific value: "build"

Type: const
Specific value: true
Type: object

The following properties are required:

  • expected_failure_reason

Expected output decoded PURL components

Type: object

Test output as an object decoded PURL components, unless expected_failure.

No Additional Properties

PURL type

Type: string or null Default: null

Package-URL type component.

PURL namespace

Type: string or null Default: null

Package-URL namespace decoded component.

PURL name

Type: string or null Default: null

Package-URL name decoded component.

PURL version

Type: string or null Default: null

Package-URL version decoded component.

PURL qualifiers

Type: object or null Default: null

Package-URL qualifiers decoded component as an object.

PURL subpath

Type: string or null Default: null

Package-URL subpath decoded component.

The following properties are required:

  • input

Test description

Type: string

A description for this test.

Test group

Type: enum (of string)

The group of this test like 'base' or 'advanced'.

Must be one of:

  • "base" :

    Test group for base conformance tests for PURL building and parsing.

  • "advanced" :

    Test group for advanced tests to support flexible PURL building and parsing.

Test type

Type: enum (of string)

The type of this test like 'build' or 'parse'.

Must be one of:

  • "build" :

    A PURL building test from decoded components to a canonical PURL string.

  • "parse" :

    A PURL building test from decoded components to a canonical PURL string.

  • "roundtrip" :

    A PURL roundtrip test, parsing then building back a PURL from a canonical string input.

Expected failure

Type: boolean Default: false

true if this test input is expected to fail to be processed.

Expected failure reason

Type: string or null Default: null

The reason why this test is is expected to fail if expected_failure is true.