Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
144 changes: 144 additions & 0 deletions schemas/vers-type-definition.schema-0.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
{
"$schema": "https://json-schema.org/2020-12/schema#",
"$id": "https://packageurl.org/schemas/vers-type-definition.schema-0.1.json",
"title": "VErsion Range Specifier (VERS) Type Definition",
"description": "Schema to define the structure of a VErsion Range Specifier (VERS) type.",
"type": "object",
"additionalProperties": false,
"definitions": {
"vers_component_definition": {
"title": "VERS component definition",
"description": "VERS component definition properties that apply to most VERS components",
"type": "object",
"properties": {
"permitted_characters": {
"title": "Permitted characters in this VERS component",
"description": "A regular expression (ECMA-262 dialect) defining the 'Permitted characters' for this component of this Package-URL type. If provided, this shall be a subset of the 'Permitted characters' defined in the PURL specification.",
"type": "string",
"format": "regex"
},
"note": {
"title": "Note",
"description": "Extra note text.",
"type": "string"
}
}
}
},
"required": [
"$id",
"type",
"type_name",
"constraints_definition",
"description",
"examples"
],
"properties": {
"$schema": {
"title": "JSON schema",
"description": "Contains the URL of the JSON schema for VERS type definition.",
"const": "https://packageurl.org/schemas/vers-type-definition.schema-0.1.json",
"format": "uri"
},
"$id": {
"title": "VERS type definition id",
"description": "The unique identifier URI for this PURL type definition.",
"type": "string",
"pattern": "^https:\\/\\/packageurl\\.org/types/[a-z0-9-]+-definition\\.json$"
},
"type": {
"title": "VERS type",
"description": "The type string for this VERS type.",
"type": "string",
"pattern": "^[a-z][a-z0-9-\\.]+$",
"examples": [
"maven",
"npm",
"pypi"
]
},
"type_name": {
"title": "Type name",
"description": "The name for this VERS type.",
"type": "string",
"examples": [
"Apache Maven math interval notation",
"npm node-semver range notation"
]
},
"description": {
"title": "Description",
"description": "The description of this VERS type.",
"type": "string"
},
"examples": {
"title": "VERS examples",
"description": "Example of valid, canonical VERS notations for this VERS type.",
"type": "array",
"uniqueItems": true,
"minItems": 1,
"items": {
"type": "string",
"pattern": "^vers:[a-z][a-z0-9-\\.]+/.*$"
}
},
"properties": {
"note": {
"title": "Note",
"description": "Extra note text.",
"type": "string"
}
}
},
"constraints_definition": {
"title": "Constraints definition",
"description": "VERS constraints as two-tuple array of (comparator, version string).",
"type": "array",
"prefixItems": [
{
"title": "VERS comparator",
"description": "A VERS version comparator.",
"type": "string",
"enum": [
"",
"*",
"=",
"!=",
">=",
">",
"<=",
"<"
]
},
{
"title": "Version",
"description": "A version string.",
"type": "string",
"examples": [
"1.2.3",
"54.a-RELEASE"
]
}
],
"allOf": [
{
"$ref": "#/definitions/ver_component_definition"
}
]
},
"note": {
"title": "Note",
"description": "Note about this VERS type.",
"type": "string"
},
"reference_urls": {
"title": "Reference URLs",
"description": "Optional list of informational reference URLs about this VERS type.",
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"format": "uri"
}
}
}