From 09634f3446866f712a022327683b1149d8f46bf0 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Mon, 28 Feb 2022 21:56:40 +0100 Subject: fix local reference in common_definitions schema * common_definitions-1.0.1.schema.json: change "$ref" line * : rename to version 1.0.1 * api_mapping_description-1.0.1.schema.json, api_query_result-1.0.1.schema.json, api_resource_description-1.0.1.schema.json, api_source_description-1.0.1.schema.json, package_source-1.0.1.schema.json: update regular expression pattern for validation of "$schema" property * : update version in "$id" property --- api_mapping_description-1.0.1.schema.json | 21 ++ api_mapping_description-1.0.1.schema.json.license | 5 + api_mapping_description-1.schema.json | 21 -- api_mapping_description-1.schema.json.license | 5 - api_query_result-1.0.1.schema.json | 25 +++ api_query_result-1.0.1.schema.json.license | 5 + api_query_result-1.schema.json | 25 --- api_query_result-1.schema.json.license | 5 - api_resource_description-1.0.1.schema.json | 26 +++ api_resource_description-1.0.1.schema.json.license | 5 + api_resource_description-1.schema.json | 26 --- api_resource_description-1.schema.json.license | 5 - api_source_description-1.0.1.schema.json | 66 ++++++ api_source_description-1.0.1.schema.json.license | 5 + api_source_description-1.schema.json | 66 ------ api_source_description-1.schema.json.license | 5 - common_definitions-1.0.1.schema.json | 233 +++++++++++++++++++++ common_definitions-1.0.1.schema.json.license | 5 + common_definitions-1.schema.json | 233 --------------------- common_definitions-1.schema.json.license | 5 - package_source-1.0.1.schema.json | 56 +++++ package_source-1.0.1.schema.json.license | 5 + package_source-1.schema.json | 56 ----- package_source-1.schema.json.license | 5 - 24 files changed, 457 insertions(+), 457 deletions(-) create mode 100644 api_mapping_description-1.0.1.schema.json create mode 100644 api_mapping_description-1.0.1.schema.json.license delete mode 100644 api_mapping_description-1.schema.json delete mode 100644 api_mapping_description-1.schema.json.license create mode 100644 api_query_result-1.0.1.schema.json create mode 100644 api_query_result-1.0.1.schema.json.license delete mode 100644 api_query_result-1.schema.json delete mode 100644 api_query_result-1.schema.json.license create mode 100644 api_resource_description-1.0.1.schema.json create mode 100644 api_resource_description-1.0.1.schema.json.license delete mode 100644 api_resource_description-1.schema.json delete mode 100644 api_resource_description-1.schema.json.license create mode 100644 api_source_description-1.0.1.schema.json create mode 100644 api_source_description-1.0.1.schema.json.license delete mode 100644 api_source_description-1.schema.json delete mode 100644 api_source_description-1.schema.json.license create mode 100644 common_definitions-1.0.1.schema.json create mode 100644 common_definitions-1.0.1.schema.json.license delete mode 100644 common_definitions-1.schema.json delete mode 100644 common_definitions-1.schema.json.license create mode 100644 package_source-1.0.1.schema.json create mode 100644 package_source-1.0.1.schema.json.license delete mode 100644 package_source-1.schema.json delete mode 100644 package_source-1.schema.json.license diff --git a/api_mapping_description-1.0.1.schema.json b/api_mapping_description-1.0.1.schema.json new file mode 100644 index 0000000..880a5c4 --- /dev/null +++ b/api_mapping_description-1.0.1.schema.json @@ -0,0 +1,21 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://hydrilla.koszko.org/schemas/api_mapping_description-1.0.1.schema.json", + "title": "Mapping description", + "description": "Definition of a Hydrilla mapping, as served through HTTP API", + "allOf": [{ + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/mapping_definition_base" + }, { + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/item_definition" + }, { + "type": "object", + "required": ["$schema"], + "properties": { + "$schema": { + "description": "Mark this instance as conforming to mapping description schema 1.x", + "type": "string", + "pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_mapping_description-1\\.(([1-9][0-9]*|0)\\.)*schema\\.json$" + } + } + }] +} diff --git a/api_mapping_description-1.0.1.schema.json.license b/api_mapping_description-1.0.1.schema.json.license new file mode 100644 index 0000000..f41d511 --- /dev/null +++ b/api_mapping_description-1.0.1.schema.json.license @@ -0,0 +1,5 @@ +SPDX-License-Identifier: CC0-1.0 + +Copyright (C) 2022 Wojtek Kosior + +Available under the terms of Creative Commons Zero v1.0 Universal. diff --git a/api_mapping_description-1.schema.json b/api_mapping_description-1.schema.json deleted file mode 100644 index e37dd00..0000000 --- a/api_mapping_description-1.schema.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://hydrilla.koszko.org/schemas/api_mapping_description-1.schema.json", - "title": "Mapping description", - "description": "Definition of a Hydrilla mapping, as served through HTTP API", - "allOf": [{ - "$ref": "./common_definitions-1.schema.json#/definitions/mapping_definition_base" - }, { - "$ref": "./common_definitions-1.schema.json#/definitions/item_definition" - }, { - "type": "object", - "required": ["$schema"], - "properties": { - "$schema": { - "description": "Mark this instance as conforming to mapping description schema 1.x", - "type": "string", - "pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_mapping_description-1\\.([1-9][0-9]*\\.)*schema\\.json$" - } - } - }] -} diff --git a/api_mapping_description-1.schema.json.license b/api_mapping_description-1.schema.json.license deleted file mode 100644 index f41d511..0000000 --- a/api_mapping_description-1.schema.json.license +++ /dev/null @@ -1,5 +0,0 @@ -SPDX-License-Identifier: CC0-1.0 - -Copyright (C) 2022 Wojtek Kosior - -Available under the terms of Creative Commons Zero v1.0 Universal. diff --git a/api_query_result-1.0.1.schema.json b/api_query_result-1.0.1.schema.json new file mode 100644 index 0000000..89c5428 --- /dev/null +++ b/api_query_result-1.0.1.schema.json @@ -0,0 +1,25 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://hydrilla.koszko.org/schemas/api_query_result-1.0.1.schema.json", + "title": "Query result", + "description": "Object with a list of references to mappings that contain payloads for requested URL", + "type": "object", + "required": ["$schema", "mappings"], + "properties": { + "$schema": { + "description": "Mark this instance as conforming to query result schema 1.x", + "type": "string", + "pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_query_result-1\\.(([1-9][0-9]*|0)\\.)*schema\\.json$" + }, + "mappings": { + "description": "References to mappings using at least one pattern that matches the requested URL", + "type": "array", + "items": { + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/item_ref" + } + }, + "generated_by": { + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/generated_by" + } + } +} diff --git a/api_query_result-1.0.1.schema.json.license b/api_query_result-1.0.1.schema.json.license new file mode 100644 index 0000000..f41d511 --- /dev/null +++ b/api_query_result-1.0.1.schema.json.license @@ -0,0 +1,5 @@ +SPDX-License-Identifier: CC0-1.0 + +Copyright (C) 2022 Wojtek Kosior + +Available under the terms of Creative Commons Zero v1.0 Universal. diff --git a/api_query_result-1.schema.json b/api_query_result-1.schema.json deleted file mode 100644 index 7de8f76..0000000 --- a/api_query_result-1.schema.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://hydrilla.koszko.org/schemas/api_query_result-1.schema.json", - "title": "Query result", - "description": "Object with a list of references to mappings that contain payloads for requested URL", - "type": "object", - "required": ["$schema", "mappings"], - "properties": { - "$schema": { - "description": "Mark this instance as conforming to query result schema 1.x", - "type": "string", - "pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_query_result-1\\.([1-9][0-9]*\\.)*schema\\.json$" - }, - "mappings": { - "description": "References to mappings using at least one pattern that matches the requested URL", - "type": "array", - "items": { - "$ref": "./common_definitions-1.schema.json#/definitions/item_ref" - } - }, - "generated_by": { - "$ref": "./common_definitions-1.schema.json#/definitions/generated_by" - } - } -} diff --git a/api_query_result-1.schema.json.license b/api_query_result-1.schema.json.license deleted file mode 100644 index f41d511..0000000 --- a/api_query_result-1.schema.json.license +++ /dev/null @@ -1,5 +0,0 @@ -SPDX-License-Identifier: CC0-1.0 - -Copyright (C) 2022 Wojtek Kosior - -Available under the terms of Creative Commons Zero v1.0 Universal. diff --git a/api_resource_description-1.0.1.schema.json b/api_resource_description-1.0.1.schema.json new file mode 100644 index 0000000..7459394 --- /dev/null +++ b/api_resource_description-1.0.1.schema.json @@ -0,0 +1,26 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://hydrilla.koszko.org/schemas/api_resource_description-1.0.1.schema.json", + "title": "Resource description", + "description": "Definition of a Hydrilla resource, as served through HTTP API", + "allOf": [{ + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/resource_definition_base" + }, { + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/item_definition" + }, { + "type": "object", + "required": ["$schema"], + "properties": { + "$schema": { + "description": "Mark this instance as conforming to resource description schema 1.x", + "type": "string", + "pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_resource_description-1\\.(([1-9][0-9]*|0)\\.)*schema\\.json$" + }, + "scripts": { + "description": "Which files are resource's scripts and need to be installed", + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/file_ref_list_sha256", + "default": [] + } + } + }] +} diff --git a/api_resource_description-1.0.1.schema.json.license b/api_resource_description-1.0.1.schema.json.license new file mode 100644 index 0000000..f41d511 --- /dev/null +++ b/api_resource_description-1.0.1.schema.json.license @@ -0,0 +1,5 @@ +SPDX-License-Identifier: CC0-1.0 + +Copyright (C) 2022 Wojtek Kosior + +Available under the terms of Creative Commons Zero v1.0 Universal. diff --git a/api_resource_description-1.schema.json b/api_resource_description-1.schema.json deleted file mode 100644 index b6a32cd..0000000 --- a/api_resource_description-1.schema.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://hydrilla.koszko.org/schemas/api_resource_description-1.schema.json", - "title": "Resource description", - "description": "Definition of a Hydrilla resource, as served through HTTP API", - "allOf": [{ - "$ref": "./common_definitions-1.schema.json#/definitions/resource_definition_base" - }, { - "$ref": "./common_definitions-1.schema.json#/definitions/item_definition" - }, { - "type": "object", - "required": ["$schema"], - "properties": { - "$schema": { - "description": "Mark this instance as conforming to resource description schema 1.x", - "type": "string", - "pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_resource_description-1\\.([1-9][0-9]*\\.)*schema\\.json$" - }, - "scripts": { - "description": "Which files are resource's scripts and need to be installed", - "$ref": "./common_definitions-1.schema.json#/definitions/file_ref_list_sha256", - "default": [] - } - } - }] -} diff --git a/api_resource_description-1.schema.json.license b/api_resource_description-1.schema.json.license deleted file mode 100644 index f41d511..0000000 --- a/api_resource_description-1.schema.json.license +++ /dev/null @@ -1,5 +0,0 @@ -SPDX-License-Identifier: CC0-1.0 - -Copyright (C) 2022 Wojtek Kosior - -Available under the terms of Creative Commons Zero v1.0 Universal. diff --git a/api_source_description-1.0.1.schema.json b/api_source_description-1.0.1.schema.json new file mode 100644 index 0000000..0744d1a --- /dev/null +++ b/api_source_description-1.0.1.schema.json @@ -0,0 +1,66 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://hydrilla.koszko.org/schemas/api_source_description-1.0.1.schema.json", + "title": "Source description", + "description": "Built description of a Hydrilla source package", + "type": "object", + "required": [ + "$schema", + "source_name", + "source_copyright", + "source_archives", + "upstream_url", + "definitions" + ], + "properties": { + "$schema": { + "description": "Mark this instance as conforming to source description schema 1.x", + "type": "string", + "pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_source_description-1\\.(([1-9][0-9]*|0)\\.)*schema\\.json$" + }, + "source_name": { + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/source_name" + }, + "source_copyright": { + "description": "Which files indicate license terms of the source package", + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/file_ref_list_sha256" + }, + "source_archives": { + "description": "What archive extensions are available for this package's sources", + "type": "object", + "required": ["zip"], + "additionalProperties": { + "description": "What is the SHA256 sum of given source archive", + "type": "object", + "required": ["sha256"], + "properties": { + "sha256": { + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/sha256" + } + } + }, + "examples": [{ + "zip": { + "sha256": "688461da362ffe2fc8e85db73e709a5356d41c8aeb7d1eee7170c64ee21dd2a2" + } + }] + }, + "upstream_url": { + "description": "Where this software/work initially comes from", + "type": "string" + }, + "comment": { + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/comment" + }, + "definitions": { + "description": "References to site resources and pattern->payload mappings", + "type": "array", + "items": { + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/typed_item_ref" + } + }, + "generated_by": { + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/generated_by" + } + } +} diff --git a/api_source_description-1.0.1.schema.json.license b/api_source_description-1.0.1.schema.json.license new file mode 100644 index 0000000..f41d511 --- /dev/null +++ b/api_source_description-1.0.1.schema.json.license @@ -0,0 +1,5 @@ +SPDX-License-Identifier: CC0-1.0 + +Copyright (C) 2022 Wojtek Kosior + +Available under the terms of Creative Commons Zero v1.0 Universal. diff --git a/api_source_description-1.schema.json b/api_source_description-1.schema.json deleted file mode 100644 index 7016b6d..0000000 --- a/api_source_description-1.schema.json +++ /dev/null @@ -1,66 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://hydrilla.koszko.org/schemas/api_source_description-1.schema.json", - "title": "Source description", - "description": "Built description of a Hydrilla source package", - "type": "object", - "required": [ - "$schema", - "source_name", - "source_copyright", - "source_archives", - "upstream_url", - "definitions" - ], - "properties": { - "$schema": { - "description": "Mark this instance as conforming to source description schema 1.x", - "type": "string", - "pattern": "^https://hydrilla\\.koszko\\.org/schemas/api_source_description-1\\.([1-9][0-9]*\\.)*schema\\.json$" - }, - "source_name": { - "$ref": "./common_definitions-1.schema.json#/definitions/source_name" - }, - "source_copyright": { - "description": "Which files indicate license terms of the source package", - "$ref": "./common_definitions-1.schema.json#/definitions/file_ref_list_sha256" - }, - "source_archives": { - "description": "What archive extensions are available for this package's sources", - "type": "object", - "required": ["zip"], - "additionalProperties": { - "description": "What is the SHA256 sum of given source archive", - "type": "object", - "required": ["sha256"], - "properties": { - "sha256": { - "$ref": "./common_definitions-1.schema.json#/definitions/sha256" - } - } - }, - "examples": [{ - "zip": { - "sha256": "688461da362ffe2fc8e85db73e709a5356d41c8aeb7d1eee7170c64ee21dd2a2" - } - }] - }, - "upstream_url": { - "description": "Where this software/work initially comes from", - "type": "string" - }, - "comment": { - "$ref": "./common_definitions-1.schema.json#/definitions/comment" - }, - "definitions": { - "description": "References to site resources and pattern->payload mappings", - "type": "array", - "items": { - "$ref": "./common_definitions-1.schema.json#/definitions/typed_item_ref" - } - }, - "generated_by": { - "$ref": "./common_definitions-1.schema.json#/definitions/generated_by" - } - } -} diff --git a/api_source_description-1.schema.json.license b/api_source_description-1.schema.json.license deleted file mode 100644 index f41d511..0000000 --- a/api_source_description-1.schema.json.license +++ /dev/null @@ -1,5 +0,0 @@ -SPDX-License-Identifier: CC0-1.0 - -Copyright (C) 2022 Wojtek Kosior - -Available under the terms of Creative Commons Zero v1.0 Universal. diff --git a/common_definitions-1.0.1.schema.json b/common_definitions-1.0.1.schema.json new file mode 100644 index 0000000..b803188 --- /dev/null +++ b/common_definitions-1.0.1.schema.json @@ -0,0 +1,233 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://hydrilla.koszko.org/schemas/common_definitions-1.0.1.schema.json", + "title": "Common definitions", + "description": "Definitions used by other Hydrilla schemas", + "definitions": { + "version": { + "description": "Version expressed as an array of integers", + "type": "array", + "minItems": 1, + "items": { + "type": "integer", + "minimum": 0 + }, + "contains": { + "type": "integer", + "minimum": 1 + }, + "minItems": 1 + }, + "source_name": { + "description": "Unique identifier of this source package", + "type": "string", + "pattern": "^[-0-9a-z.]+$" + }, + "comment": { + "description": "An optional comment", + "type": "string" + }, + "file_ref_list": { + "description": "List of simple file references", + "type": "array", + "items": { + "type": "object", + "required": ["file"], + "properties": { + "file": { + "description": "Filename relative to source package main directory; separator is '/'", + "type": "string", + "pattern": "^[^/]" + } + } + } + }, + "sha256": { + "description": "An SHA256 sum, in hexadecimal", + "type": "string", + "pattern": "^[0-9a-f]{64}$" + }, + "file_ref_list_sha256": { + "description": "List of file references with files' SHA256 sums included", + "allOf": [{ + "$ref": "#/definitions/file_ref_list" + }, { + "type": "array", + "items": { + "type": "object", + "required": ["sha256"], + "properties": { + "sha256": { + "$ref": "#/definitions/sha256" + } + } + } + }] + }, + "item_identifier": { + "description": "Identifier of an item (shared with other versions of the item, otherwise unique)", + "type": "string", + "pattern": "^[-0-9a-z]+$" + }, + "item_dep_specifier": { + "description": "Simple reference to an item as a dependency", + "type": "object", + "required": ["identifier"], + "properties": { + "identifier": { + "$ref": "#/definitions/item_identifier" + } + } + }, + "item_ref": { + "description": "An object containing a subset of fields from full item definition", + "type": "object", + "required": ["identifier", "long_name", "version"], + "properties": { + "identifier": { + "$ref": "#/definitions/item_identifier" + }, + "long_name": { + "description": "User-friendly alternative to the identifier", + "type": "string" + }, + "version": { + "$ref": "#/definitions/version" + } + } + }, + "typed_item_ref": { + "description": "An object containing a subset of fields from full item definition, including type", + "allOf": [{ + "$ref": "#/definitions/item_ref" + }, { + "type": "object", + "required": ["type"], + "properties": { + "type": { + "description": "What kind of item is it (resource or mapping)", + "enum": ["resource", "mapping"] + } + } + }] + }, + "item_definition_base": { + "description": "Definition of a resource/mapping (fields common to source definitions and built definitions)", + "allOf": [{ + "$ref": "#/definitions/typed_item_ref" + }, { + "type": "object", + "required": ["description"], + "properties": { + "uuid": { + "description": "UUIDv4 of this item (shared with other versions of this item, otherwise unique)", + "type": "string", + "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" + }, + "description": { + "description": "Item's description", + "type": "string" + }, + "comment": { + "$ref": "#/definitions/comment" + } + } + }] + }, + "resource_definition_base": { + "description": "Definition of a resource (fields common to source definitions and built definitions)", + "allOf": [{ + "$ref": "#/definitions/item_definition_base" + }, { + "type": "object", + "required": ["type", "revision"], + "properties": { + "type": { + "description": "Identify this item as a resource", + "const": "resource" + }, + "revision": { + "description": "Which revision of a packaging of given version of an upstream resource is this", + "type": "integer", + "minimum": 1 + }, + "scripts": { + "description": "What scripts are included in the resource", + "$ref": "#/definitions/file_ref_list", + "default": [] + }, + "dependencies": { + "description": "Which other resources this resource depends on", + "type": "array", + "items": { + "$ref": "#/definitions/item_dep_specifier" + }, + "default": [] + } + } + }] + }, + "mapping_definition_base": { + "description": "Definition of a mapping (fields common to source definitions and built definitions)", + "allOf": [{ + "$ref": "#/definitions/item_definition_base" + }, { + "type": "object", + "required": ["type"], + "properties": { + "type": { + "description": "Identify this item as a mapping", + "const": "mapping" + }, + "payloads": { + "description": "Which payloads are to be applied to which URLs", + "additionalProperties": { + "$ref": "#/definitions/item_dep_specifier" + }, + "default": {}, + "examples": [{ + "https://hydrillabugs.koszko.org/***": { + "identifier": "helloapple" + }, + "https://*.koszko.org/***": { + "identifier": "hello-potato" + } + }] + } + } + }] + }, + "generated_by": { + "description": "Describe what software generated this instance", + "type": "object", + "required": ["name"], + "properties": { + "name": { + "type": "string", + "description": "Instance generator software name, without version" + }, + "version": { + "type": "string", + "description": "Instance generator software version, in arbitrary format" + } + } + }, + "item_definition": { + "description": "Definition of a resource/mapping (fields specific to built definitions)", + "type": "object", + "required": ["source_name", "source_copyright"], + "properties": { + "source_name": { + "$ref": "#/definitions/source_name" + }, + "source_copyright": { + "description": "Which files indicate license terms of the source package and should be installed", + "$ref": "#/definitions/file_ref_list_sha256" + }, + "generated_by": { + "$ref": "#/definitions/generated_by" + } + } + } + } +} diff --git a/common_definitions-1.0.1.schema.json.license b/common_definitions-1.0.1.schema.json.license new file mode 100644 index 0000000..f41d511 --- /dev/null +++ b/common_definitions-1.0.1.schema.json.license @@ -0,0 +1,5 @@ +SPDX-License-Identifier: CC0-1.0 + +Copyright (C) 2022 Wojtek Kosior + +Available under the terms of Creative Commons Zero v1.0 Universal. diff --git a/common_definitions-1.schema.json b/common_definitions-1.schema.json deleted file mode 100644 index f88a9cd..0000000 --- a/common_definitions-1.schema.json +++ /dev/null @@ -1,233 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://hydrilla.koszko.org/schemas/common_definitions-1.schema.json", - "title": "Common definitions", - "description": "Definitions used by other Hydrilla schemas", - "definitions": { - "version": { - "description": "Version expressed as an array of integers", - "type": "array", - "minItems": 1, - "items": { - "type": "integer", - "minimum": 0 - }, - "contains": { - "type": "integer", - "minimum": 1 - }, - "minItems": 1 - }, - "source_name": { - "description": "Unique identifier of this source package", - "type": "string", - "pattern": "^[-0-9a-z.]+$" - }, - "comment": { - "description": "An optional comment", - "type": "string" - }, - "file_ref_list": { - "description": "List of simple file references", - "type": "array", - "items": { - "type": "object", - "required": ["file"], - "properties": { - "file": { - "description": "Filename relative to source package main directory; separator is '/'", - "type": "string", - "pattern": "^[^/]" - } - } - } - }, - "sha256": { - "description": "An SHA256 sum, in hexadecimal", - "type": "string", - "pattern": "^[0-9a-f]{64}$" - }, - "file_ref_list_sha256": { - "description": "List of file references with files' SHA256 sums included", - "allOf": [{ - "$ref": "#/definitions/file_ref_list" - }, { - "type": "array", - "items": { - "type": "object", - "required": ["sha256"], - "properties": { - "sha256": { - "$ref": "#/definitions/sha256" - } - } - } - }] - }, - "item_identifier": { - "description": "Identifier of an item (shared with other versions of the item, otherwise unique)", - "type": "string", - "pattern": "^[-0-9a-z]+$" - }, - "item_dep_specifier": { - "description": "Simple reference to an item as a dependency", - "type": "object", - "required": ["identifier"], - "properties": { - "identifier": { - "$ref": "#/definitions/item_identifier" - } - } - }, - "item_ref": { - "description": "An object containing a subset of fields from full item definition", - "type": "object", - "required": ["identifier", "long_name", "version"], - "properties": { - "identifier": { - "$ref": "#/definitions/item_identifier" - }, - "long_name": { - "description": "User-friendly alternative to the identifier", - "type": "string" - }, - "version": { - "$ref": "#definitions/version" - } - } - }, - "typed_item_ref": { - "description": "An object containing a subset of fields from full item definition, including type", - "allOf": [{ - "$ref": "#/definitions/item_ref" - }, { - "type": "object", - "required": ["type"], - "properties": { - "type": { - "description": "What kind of item is it (resource or mapping)", - "enum": ["resource", "mapping"] - } - } - }] - }, - "item_definition_base": { - "description": "Definition of a resource/mapping (fields common to source definitions and built definitions)", - "allOf": [{ - "$ref": "#/definitions/typed_item_ref" - }, { - "type": "object", - "required": ["description"], - "properties": { - "uuid": { - "description": "UUIDv4 of this item (shared with other versions of this item, otherwise unique)", - "type": "string", - "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" - }, - "description": { - "description": "Item's description", - "type": "string" - }, - "comment": { - "$ref": "#/definitions/comment" - } - } - }] - }, - "resource_definition_base": { - "description": "Definition of a resource (fields common to source definitions and built definitions)", - "allOf": [{ - "$ref": "#/definitions/item_definition_base" - }, { - "type": "object", - "required": ["type", "revision"], - "properties": { - "type": { - "description": "Identify this item as a resource", - "const": "resource" - }, - "revision": { - "description": "Which revision of a packaging of given version of an upstream resource is this", - "type": "integer", - "minimum": 1 - }, - "scripts": { - "description": "What scripts are included in the resource", - "$ref": "#/definitions/file_ref_list", - "default": [] - }, - "dependencies": { - "description": "Which other resources this resource depends on", - "type": "array", - "items": { - "$ref": "#/definitions/item_dep_specifier" - }, - "default": [] - } - } - }] - }, - "mapping_definition_base": { - "description": "Definition of a mapping (fields common to source definitions and built definitions)", - "allOf": [{ - "$ref": "#/definitions/item_definition_base" - }, { - "type": "object", - "required": ["type"], - "properties": { - "type": { - "description": "Identify this item as a mapping", - "const": "mapping" - }, - "payloads": { - "description": "Which payloads are to be applied to which URLs", - "additionalProperties": { - "$ref": "#/definitions/item_dep_specifier" - }, - "default": {}, - "examples": [{ - "https://hydrillabugs.koszko.org/***": { - "identifier": "helloapple" - }, - "https://*.koszko.org/***": { - "identifier": "hello-potato" - } - }] - } - } - }] - }, - "generated_by": { - "description": "Describe what software generated this instance", - "type": "object", - "required": ["name"], - "properties": { - "name": { - "type": "string", - "description": "Instance generator software name, without version" - }, - "version": { - "type": "string", - "description": "Instance generator software version, in arbitrary format" - } - } - }, - "item_definition": { - "description": "Definition of a resource/mapping (fields specific to built definitions)", - "type": "object", - "required": ["source_name", "source_copyright"], - "properties": { - "source_name": { - "$ref": "#/definitions/source_name" - }, - "source_copyright": { - "description": "Which files indicate license terms of the source package and should be installed", - "$ref": "#/definitions/file_ref_list_sha256" - }, - "generated_by": { - "$ref": "#/definitions/generated_by" - } - } - } - } -} diff --git a/common_definitions-1.schema.json.license b/common_definitions-1.schema.json.license deleted file mode 100644 index f41d511..0000000 --- a/common_definitions-1.schema.json.license +++ /dev/null @@ -1,5 +0,0 @@ -SPDX-License-Identifier: CC0-1.0 - -Copyright (C) 2022 Wojtek Kosior - -Available under the terms of Creative Commons Zero v1.0 Universal. diff --git a/package_source-1.0.1.schema.json b/package_source-1.0.1.schema.json new file mode 100644 index 0000000..2f9482e --- /dev/null +++ b/package_source-1.0.1.schema.json @@ -0,0 +1,56 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://hydrilla.koszko.org/schemas/package_source-1.0.1.schema.json", + "title": "Package source", + "description": "Definition of a Hydrilla source package", + "type": "object", + "required": [ + "$schema", + "source_name", + "copyright", + "upstream_url", + "definitions" + ], + "properties": { + "$schema": { + "description": "Mark this instance as conforming to package source schema 1.x", + "type": "string", + "pattern": "^https://hydrilla\\.koszko\\.org/schemas/package_source-1\\.(([1-9][0-9]*|0)\\.)*schema\\.json$" + }, + "source_name": { + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/source_name" + }, + "copyright": { + "description": "Which files from the source package indicate its license terms and should be included in the distribution packages", + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/file_ref_list" + }, + "upstream_url": { + "description": "Where this software/work initially comes from", + "type": "string" + }, + "comment": { + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/comment" + }, + "definitions": { + "description": "Definitions of site resources and pattern->payload mappings", + "type": "array", + "items": { + "anyOf": [{ + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/resource_definition_base" + }, { + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/mapping_definition_base" + }] + } + }, + "additional_files": { + "description": "Files which should be included in the source archive produced by Hydrilla builder in addition to script and copyright files", + "$ref": "./common_definitions-1.0.1.schema.json#/definitions/file_ref_list", + "default": [] + }, + "reuse_generate_spdx_report": { + "description": "Should report.spdx be automatically generated for the package using REUSE tool", + "type": "boolean", + "default": false + } + } +} diff --git a/package_source-1.0.1.schema.json.license b/package_source-1.0.1.schema.json.license new file mode 100644 index 0000000..f41d511 --- /dev/null +++ b/package_source-1.0.1.schema.json.license @@ -0,0 +1,5 @@ +SPDX-License-Identifier: CC0-1.0 + +Copyright (C) 2022 Wojtek Kosior + +Available under the terms of Creative Commons Zero v1.0 Universal. diff --git a/package_source-1.schema.json b/package_source-1.schema.json deleted file mode 100644 index e7e0064..0000000 --- a/package_source-1.schema.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://hydrilla.koszko.org/schemas/package_source-1.schema.json", - "title": "Package source", - "description": "Definition of a Hydrilla source package", - "type": "object", - "required": [ - "$schema", - "source_name", - "copyright", - "upstream_url", - "definitions" - ], - "properties": { - "$schema": { - "description": "Mark this instance as conforming to package source schema 1.x", - "type": "string", - "pattern": "^https://hydrilla\\.koszko\\.org/schemas/package_source-1\\.([1-9][0-9]*\\.)*schema\\.json$" - }, - "source_name": { - "$ref": "./common_definitions-1.schema.json#/definitions/source_name" - }, - "copyright": { - "description": "Which files from the source package indicate its license terms and should be included in the distribution packages", - "$ref": "./common_definitions-1.schema.json#/definitions/file_ref_list" - }, - "upstream_url": { - "description": "Where this software/work initially comes from", - "type": "string" - }, - "comment": { - "$ref": "./common_definitions-1.schema.json#/definitions/comment" - }, - "definitions": { - "description": "Definitions of site resources and pattern->payload mappings", - "type": "array", - "items": { - "anyOf": [{ - "$ref": "./common_definitions-1.schema.json#/definitions/resource_definition_base" - }, { - "$ref": "./common_definitions-1.schema.json#/definitions/mapping_definition_base" - }] - } - }, - "additional_files": { - "description": "Files which should be included in the source archive produced by Hydrilla builder in addition to script and copyright files", - "$ref": "./common_definitions-1.schema.json#/definitions/file_ref_list", - "default": [] - }, - "reuse_generate_spdx_report": { - "description": "Should report.spdx be automatically generated for the package using REUSE tool", - "type": "boolean", - "default": false - } - } -} diff --git a/package_source-1.schema.json.license b/package_source-1.schema.json.license deleted file mode 100644 index f41d511..0000000 --- a/package_source-1.schema.json.license +++ /dev/null @@ -1,5 +0,0 @@ -SPDX-License-Identifier: CC0-1.0 - -Copyright (C) 2022 Wojtek Kosior - -Available under the terms of Creative Commons Zero v1.0 Universal. -- cgit v1.2.3