From 987703e68df247e1def775e3ba524534714a069f Mon Sep 17 00:00:00 2001 From: Kingthorin Date: Thu, 21 May 2020 19:50:53 -0400 Subject: [PATCH] Simplify schema.json using definitions/refs Signed-off-by: Kingthorin --- schema.json | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/schema.json b/schema.json index 428284fa1..c5a875676 100644 --- a/schema.json +++ b/schema.json @@ -1,5 +1,11 @@ { "title": "Wappalyzer Schema", + "definitions": { + "non-empty-non-blank-sting": { + "type": "string", + "pattern": "^(?!\\s*$).+" + } + }, "type": "object", "additionalProperties": false, "required": ["categories","apps"], @@ -39,8 +45,7 @@ "minItems": 1 }, "cpe": { - "type": "string", - "pattern": "^(?!\\s*$).+" + "$ref": "#/definitions/non-empty-non-blank-sting" }, "cookies": { "type": "object", @@ -80,13 +85,11 @@ { "type": "array", "items": { - "type": "string", - "pattern": "^(?!\\s*$).+" + "$ref": "#/definitions/non-empty-non-blank-sting" } }, { - "type": "string", - "pattern": "^(?!\\s*$).+" + "$ref": "#/definitions/non-empty-non-blank-sting" } ] }, @@ -95,13 +98,11 @@ { "type": "array", "items": { - "type": "string", - "pattern": "^(?!\\s*$).+" + "$ref": "#/definitions/non-empty-non-blank-sting" } }, { - "type": "string", - "pattern": "^(?!\\s*$).+" + "$ref": "#/definitions/non-empty-non-blank-sting" } ] }, @@ -110,13 +111,11 @@ { "type": "array", "items": { - "type": "string", - "pattern": "^(?!\\s*$).+" + "$ref": "#/definitions/non-empty-non-blank-sting" } }, { - "type": "string", - "pattern": "^(?!\\s*$).+" + "$ref": "#/definitions/non-empty-non-blank-sting" } ] }, @@ -136,27 +135,22 @@ { "type": "array", "items": { - "type": "string", - "pattern": "^(?!\\s*$).+" + "$ref": "#/definitions/non-empty-non-blank-sting" } }, { - "type": "string", - "pattern": "^(?!\\s*$).+" + "$ref": "#/definitions/non-empty-non-blank-sting" } ] }, "url": { - "type": "string", - "pattern": "^(?!\\s*$).+" + "$ref": "#/definitions/non-empty-non-blank-sting" }, "website": { - "type": "string", - "pattern": "^(?!\\s*$).+" + "$ref": "#/definitions/non-empty-non-blank-sting" }, "icon": { - "type": "string", - "pattern": "^(?!\\s*$).+" + "$ref": "#/definitions/non-empty-non-blank-sting" } } }