Skip to content

Issues in vers-test.schema-0.1.json #68

@peinjoh

Description

@peinjoh

Hey there,

I believe I have found some (potential) issues concering vers-test.schema-0.1.json:

In line 566 - 572:

"properties": {
  "$schema": {
    "title": "JSON schema",
    "description": "Contains the URL of the JSON schema for Version Range Specifier tests.",
    "constant": "https://packageurl.org/schemas/vers-test.schema-1.0.json",
    "format": "uri"
  },

The keyword for constant values in Draft 7 is const. Also, the value references vers-test.schema-1.0.json (which resolves to "Page Not Found"). I believe is meant to be https://packageurl.org/schemas/vers-test.schema-0.1.json (which resolves to the file itself).

In line 8 - 15:

"definitions": {
  "version_constraint": {
    "title": "VERS version constraint",
    "description": "A VERS version constraint as two-tuple array of (comparator, version string).",
    "type": "array",
    "additionalProperties": false,
    "minItems": 2,
    "maxItems": 2,

The version_constraint is an array, but the keyword additionalProperties exists in the context of objects. I believe you meant additionalItems: false here? I would argue this would also be redundant, as items, minItems: 2 and maxItems: 2 already pin the exact tuples you want to allow here?

In line 410 - 432:

"title": "Input for version comparison",
"description": "A VERS scheme and a list of version strings to use as sorting test input.",
"type": "object",
"required": [
  "scheme",
  "versions"
],
"properties": {
  "input_scheme": {
    "title": "VERS scheme",
    "description": "A versioning scheme.",
    "type": "string"
  },
  "versions": {
    "title": "Input list of bare versions",
    "description": "Test input as a list of bare versions strings.",
    "type": "array",
    "minItems": 2,
    "items": {
      "type": "string"
    }
  }
}

The required and properties fields contain a mismatch: required contains scheme, properties contains input_scheme. I believe this is unintended, and the same property should be both required and typed as a string. A similar issue exists in line 468 - 489 with the same property naming mismatch and and also in line 160 - 192. There, required contains scheme and properties contains data_source.

In line 273 - 302:

{
  "if": {
    "properties": {
      "test_type": {
        "const": "roundtrip"
      }
    },
    "required": [
      "test_type"
    ]
  },
  "then": {
    "properties": {
      "input": {
        "title": "Input test VERS",
        "description": "A VERS string to use as a test input (canonical or not).",
        "type": "string"
      },
      "expected_output": {
        "title": "Expected canonical VERS",
        "description": "A canonical VERS string to use as a test ouput.",
        "type": "string"
      }
    },
    "required": [
      "input",
      "expected_output"
    ]
  }
},

For the other test_types (with the exception of invert, see below) expected_failure is used in the branches. For test_type roundtrip, this is not the case. As both input and expected_output are required further down, I would argue the existing branch should have expected_failure set to false.

Also: the test_type invert is defined, but there is mention of it in the allOf / if/then structure. Is this intended?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions