From 7fc0aa8d8cd58f080e94104b8a001cd09aacf618 Mon Sep 17 00:00:00 2001 From: Richard Kuhnt Date: Sat, 15 Apr 2017 13:12:28 +0200 Subject: [PATCH] Add hash extraction for each architecture to schema --- schema.json | 89 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 53 insertions(+), 36 deletions(-) diff --git a/schema.json b/schema.json index 67b0ebc76..f105a5d1a 100644 --- a/schema.json +++ b/schema.json @@ -22,6 +22,52 @@ } ] }, + "hashExtraction": { + "additionalProperties": false, + "properties": { + "find": { + "format": "regex", + "type": "string" + }, + "jp": { + "pattern": "^\\$\\..*$", + "type": "string" + }, + "mode": { + "enum": [ + "download", + "extract", + "json", + "rdf" + ] + }, + "type": { + "enum": [ + "md5", + "sha1", + "sha256", + "sha512" + ] + }, + "url": { + "anyOf": [ + { + "format": "uri", + "type": "string" + }, + { + "pattern": "^\\$url.[\\w\\d]+$", + "type": "string" + }, + { + "pattern": "^.*\\$url.*$", + "type": "string" + } + ] + } + }, + "type": "object" + }, "architecture": { "additionalProperties": false, "properties": { @@ -85,6 +131,9 @@ "url": { "format": "uri", "type": "string" + }, + "hash": { + "$ref": "#/definitions/hashExtraction" } }, "type": "object" @@ -98,6 +147,9 @@ "url": { "format": "uri", "type": "string" + }, + "hash": { + "$ref": "#/definitions/hashExtraction" } }, "type": "object" @@ -109,42 +161,7 @@ "type": "string" }, "hash": { - "additionalProperties": false, - "properties": { - "find": { - "format": "regex", - "type": "string" - }, - "jp": { - "pattern": "^\\$\\..*$", - "type": "string" - }, - "mode": { - "enum": [ - "download", - "extract", - "json", - "rdf" - ] - }, - "url": { - "anyOf": [ - { - "format": "uri", - "type": "string" - }, - { - "pattern": "^\\$url.[\\w\\d]+$", - "type": "string" - }, - { - "pattern": "^.*\\$url.*$", - "type": "string" - } - ] - } - }, - "type": "object" + "$ref": "#/definitions/hashExtraction" }, "note": { "$ref": "#/definitions/stringOrArrayOfStrings"