vers-test.schema-0.2.json

Type: object

Schema for Version Range Specifier (VERS) test case definitions.

No Additional Properties

JSON schema

Type: constFormat: uri

Contains the URL of the JSON schema for Version Range Specifier tests.

Specific value: "https://packageurl.org/vers-schemas/vers-test.schema-0.2.json"

Test suite

Type: array

A list of Version Range Specifier tests.

Must contain a minimum of 1 items

All items must be unique

No Additional Items

Each item of this array must be:

VERS test

Type: object

A VERS 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: "from_native"

Type: const
Specific value: false
Type: object

Input for conversion from native version range to VERS

Type: object

An object with a data source and native version range data to use in a conversion test from native data.

The following properties are required:

  • type

Data source for test input

Type: string

A string (like a VERS type) or URL that identifies the source of the data for this test input.


Examples:

"https://github.com/npm/node-semver#ranges"
"https://gitlab.com/gitlab-org/advisories-community/-/tree/main/packagist"
"https://gitlab.com/gitlab-org/advisories-community/-/tree/main/go"
"https://git.alpinelinux.org/apk-tools/tree/test/unit/version.data"
"https://github.com/rpm-software-management/rpm/blob/master/tests/rpmvercmp.at"

Input native version range

Type: string, object or array

A native version range data that can be any of a string, array or object.

Expected canonical VERS

Type: string

A canonical VERS string to use as a test 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 VERS

Type: string

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

Expected output decoded VERS components

Type: object

Test output to use as an object of decoded VERS components.

VERS type

Type: string

A VERS type (aka versioning scheme.)


Examples:

"maven"
"npm"
"pypi"
"semver"

VERS constraints list

Type: array

A list of version constraints as two-tuples of (comparator, version).

Must contain a minimum of 1 items

All items must be unique

No Additional Items

Each item of this array must be:

VERS constraint

Type: array

A VERS constraint is a two-tuple array of (comparator, version string).

No Additional Items

Tuple Validation

Item at 1 must be:

VERS comparator

Type: enum (of string)

A VERS version comparator.

Must be one of:

  • ""
  • "*"
  • "="
  • "!="
  • ">="
  • ">"
  • "<="
  • "<"
Item at 2 must be:

Version

Type: string

A version string.


Examples:

"1.2.3"
"54.a-RELEASE"
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

Input decoded VERS components

Type: object

Test input as an object of decoded VERS components.

VERS type

Type: string

A VERS type (aka versioning scheme.)


Examples:

"maven"
"npm"
"pypi"
"semver"

VERS constraints list

Type: array

A list of version constraints as two-tuples of (comparator, version).

Must contain a minimum of 1 items

All items must be unique

No Additional Items

Each item of this array must be:

VERS constraint

Type: array

A VERS constraint is a two-tuple array of (comparator, version string).

No Additional Items

Tuple Validation

Item at 1 must be:

VERS comparator

Type: enum (of string)

A VERS version comparator.

Must be one of:

  • ""
  • "*"
  • "="
  • "!="
  • ">="
  • ">"
  • "<="
  • "<"
Item at 2 must be:

Version

Type: string

A version string.


Examples:

"1.2.3"
"54.a-RELEASE"

Expected canonical VERS

Type: string

A canonical VERS string to use as a test 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: "validate"
Type: object

Input test VERS

Type: string

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

Expected canonical VERS

Type: string

A canonical VERS string to use as a test 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: "merge"

Type: const
Specific value: false
Type: object

Input list of VERS strings

Type: array of string

Test input as a list of VERS strings.

Must contain a minimum of 1 items

All items must be unique

No Additional Items

Each item of this array must be:

Type: string

Expected canonical VERS

Type: string

An expected canonical merged VERS string to use as a test 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: "containment"

Type: const
Specific value: false
Type: object

Input for version containment

Type: object

A version and a VERS string to use as a containment test input.

Input test version

Type: string

A version string to test for containment in the input VERS.

Input test VERS

Type: string

A canonical VERS string used to test its containment of the input version.

True if the version is expected to be contained in the input VERS

Type: boolean

A true boolean if the version is contained in the input VERS - otherwise false.

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: "comparison"

Type: const
Specific value: false
Type: object

Input for version comparison

Type: object

A VERS type and a list of version strings to use as sorting test input.

VERS type to use as an input for a comparison test.

Type: string

VERS type (aka versioning scheme).

Input list of bare versions

Type: array of string

Test input as a list of bare versions strings.

Must contain a minimum of 2 items

No Additional Items

Each item of this array must be:

Type: string

Expected sorted list of bare versions

Type: array of string

An expected sorted list of version strings to use as a test output.

Must contain a minimum of 2 items

No Additional Items

Each item of this array must be:

Type: string
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: "equality"

Type: const
Specific value: false
Type: object

Input for version equality

Type: object

A VERS type and a two-tuple of version strings to compare.

VERS type

Type: string

VERS type to use as an input for an equality test.

Input tuple of two bare versions

Type: array of string

Test input as a tuple of two bare versions strings.

Must contain a minimum of 2 items

Must contain a maximum of 2 items

No Additional Items

Each item of this array must be:

Type: string

True if two bare versions are expected to be equal

Type: boolean

A true boolean if two bare versions are expected to be equal to use as a test 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: true
Type: object

The following properties are required:

  • expected_message

Input test VERS

Type: string

A VERS 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_message

Input VERS components

Type: object

Test input as an object of decoded VERS components.

VERS type

Type: string

A VERS type (aka versioning scheme.)


Examples:

"maven"
"npm"
"pypi"
"semver"

VERS constraints list

Type: array

A list of version constraints as two-tuples of (comparator, version).

Must contain a minimum of 1 items

All items must be unique

No Additional Items

Each item of this array must be:

VERS constraint

Type: array

A VERS constraint is a two-tuple array of (comparator, version string).

No Additional Items

Tuple Validation

Item at 1 must be:

VERS comparator

Type: enum (of string)

A VERS version comparator.

Must be one of:

  • ""
  • "*"
  • "="
  • "!="
  • ">="
  • ">"
  • "<="
  • "<"
Item at 2 must be:

Version

Type: string

A version string.


Examples:

"1.2.3"
"54.a-RELEASE"

The following properties are required:

  • input

Test description

Type: string

A description for this test.

Test group

Type: enum (of string)

The conformance group of this test case.

Must be one of:

  • "required" :

    Test group for test cases required for conformance with the VERS standard - ECMA-nnn

  • "recommended" :

    Test group for test cases recommended to identify common problems in VERS data and how to remediate or normalize them in order to pass 'required' tests.

Test type

Type: enum (of string)

The functional type of this test case.

Must be one of:

  • "build" :

    A test case to build a canonical VERS string from decoded components.

  • "comparison" :

    A test case to sort an input version string array using the applicable VERS type rules.

  • "containment" :

    A test case to determine if a bare version string is contained within the range of a VERS string.

  • "equality" :

    A test case to check if two input version strings are equal using the applicable VERS type rules.

  • "from_native" :

    A test case to construct a canonical VERS string from a native ecosystem data source.

  • "invert" :

    A test case to invert a VERS string into a canonical VERS string

  • "merge" :

    A test case to merge an array of VERS strings into a canonical VERS string.

  • "parse" :

    A test case to parse a VERS string into a decoded VERS type and a constraints list

  • "validate" :

    A test case to validate that an input VERS is in canonical form.

Expected failure

Type: boolean Default: false

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

Expected test message

Type: string or null Default: null

The reason why this test is is expected to fail if expected_failure is true, or another message about the test result .