From e5dc47e4c8bf7d9fa1c8e06412050941ab88badd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 7 Mar 2017 11:09:55 +0100 Subject: [PATCH] Update schema --- schema.json | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/schema.json b/schema.json index 999134e..d5defa4 100644 --- a/schema.json +++ b/schema.json @@ -2,7 +2,46 @@ "$schema": "http://json-schema.org/schema#", "title": "Validator for misp-objects", "id": "https://www.github.com/MISP/misp-objects/schema.json", + "defs": { + "attribute": { + "type": "object", + "additionalProperties": false, + "properties": { + "misp-attribute": { + "type": "string" + }, + "misp-usage-frequency": { + "type": "number" + }, + "categories": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "required_value": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "multiple": { + "type": "boolean" + }, + "description": { + "type": "string" + } + }, + "required": [ + "misp-attribute", + "misp-usage-frequency" + ] + } + }, "type": "object", + "additionalProperties": false, "properties": { "meta-category": { "type": "string" @@ -17,7 +56,25 @@ "type": "integer" }, "attributes": { - "type": "object" + "type": "object", + "additionalProperties": { + "type": "object", + "$ref": "#/defs/attribute" + } + }, + "requiredOneOf": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "required": { + "type": "array", + "uniqueItems": true, + "items": { + "type": "string" + } } }, "required": [