Simplify schema.json using definitions/refs

Signed-off-by: Kingthorin <kingthorin@users.noreply.github.com>
main
Kingthorin 5 years ago
parent 0e6555836d
commit 987703e68d

@ -1,5 +1,11 @@
{ {
"title": "Wappalyzer Schema", "title": "Wappalyzer Schema",
"definitions": {
"non-empty-non-blank-sting": {
"type": "string",
"pattern": "^(?!\\s*$).+"
}
},
"type": "object", "type": "object",
"additionalProperties": false, "additionalProperties": false,
"required": ["categories","apps"], "required": ["categories","apps"],
@ -39,8 +45,7 @@
"minItems": 1 "minItems": 1
}, },
"cpe": { "cpe": {
"type": "string", "$ref": "#/definitions/non-empty-non-blank-sting"
"pattern": "^(?!\\s*$).+"
}, },
"cookies": { "cookies": {
"type": "object", "type": "object",
@ -80,13 +85,11 @@
{ {
"type": "array", "type": "array",
"items": { "items": {
"type": "string", "$ref": "#/definitions/non-empty-non-blank-sting"
"pattern": "^(?!\\s*$).+"
} }
}, },
{ {
"type": "string", "$ref": "#/definitions/non-empty-non-blank-sting"
"pattern": "^(?!\\s*$).+"
} }
] ]
}, },
@ -95,13 +98,11 @@
{ {
"type": "array", "type": "array",
"items": { "items": {
"type": "string", "$ref": "#/definitions/non-empty-non-blank-sting"
"pattern": "^(?!\\s*$).+"
} }
}, },
{ {
"type": "string", "$ref": "#/definitions/non-empty-non-blank-sting"
"pattern": "^(?!\\s*$).+"
} }
] ]
}, },
@ -110,13 +111,11 @@
{ {
"type": "array", "type": "array",
"items": { "items": {
"type": "string", "$ref": "#/definitions/non-empty-non-blank-sting"
"pattern": "^(?!\\s*$).+"
} }
}, },
{ {
"type": "string", "$ref": "#/definitions/non-empty-non-blank-sting"
"pattern": "^(?!\\s*$).+"
} }
] ]
}, },
@ -136,27 +135,22 @@
{ {
"type": "array", "type": "array",
"items": { "items": {
"type": "string", "$ref": "#/definitions/non-empty-non-blank-sting"
"pattern": "^(?!\\s*$).+"
} }
}, },
{ {
"type": "string", "$ref": "#/definitions/non-empty-non-blank-sting"
"pattern": "^(?!\\s*$).+"
} }
] ]
}, },
"url": { "url": {
"type": "string", "$ref": "#/definitions/non-empty-non-blank-sting"
"pattern": "^(?!\\s*$).+"
}, },
"website": { "website": {
"type": "string", "$ref": "#/definitions/non-empty-non-blank-sting"
"pattern": "^(?!\\s*$).+"
}, },
"icon": { "icon": {
"type": "string", "$ref": "#/definitions/non-empty-non-blank-sting"
"pattern": "^(?!\\s*$).+"
} }
} }
} }