Make the schema more sane

pull/73/head
Raphaël Vinot 2017-07-19 17:47:19 +02:00
parent bed7452291
commit 08d87573d4
1 changed files with 103 additions and 97 deletions

View File

@ -1,42 +1,84 @@
{ {
"required": [ "$schema": "http://json-schema.org/schema#",
"namespace", "title": "Validator for misp-taxonomies",
"description", "id": "https://www.github.com/MISP/misp-taxonomies/schema.json",
"version", "defs": {
"predicates" "entry": {
], "type": "array",
"properties": {
"type": {
"minItems": 1,
"items": {
"type": "string"
},
"uniqueItems": true, "uniqueItems": true,
"type": "array"
},
"refs": {
"items": { "items": {
"type": "string" "type": "object",
}, "additionalProperties": false,
"uniqueItems": true, "properties": {
"type": "array" "numerical_value": {
"type": "number"
},
"expanded": {
"type": "string"
},
"description": {
"type": "string"
},
"value": {
"type": "string"
},
"required": [
"value"
]
}
}
}, },
"values": { "values": {
"items": { "type": "array",
"$ref": "#/defs/entry",
"type": "object"
},
"uniqueItems": true, "uniqueItems": true,
"type": "array" "items": {
"type": "object",
"additionalProperties": false,
"properties": {
"entry": {
"$ref": "#/defs/entry"
},
"predicate": {
"type": "string"
}
},
"required": [
"predicate"
]
}
}, },
"predicates": { "predicates": {
"items": { "type": "array",
"$ref": "#/defs/predicate",
"type": "object"
},
"uniqueItems": true, "uniqueItems": true,
"type": "array" "items": {
}, "type": "object",
"additionalProperties": false,
"properties": {
"numerical_value": {
"type": "number"
},
"colour": {
"type": "string"
},
"description": {
"type": "string"
},
"expanded": {
"type": "string"
},
"value": {
"type": "string"
},
"required": [
"value"
]
}
}
}
},
"type": "object",
"additionalProperties": false,
"properties": {
"version": { "version": {
"type": "integer" "type": "integer"
}, },
@ -48,74 +90,38 @@
}, },
"namespace": { "namespace": {
"type": "string" "type": "string"
}
},
"additionalProperties": false,
"type": "object",
"defs": {
"required": [
"predicate"
],
"entry": {
"properties": {
"entry": {
"items": {
"required": [
"value"
],
"properties": {
"numerical_value": {
"type": "number"
},
"expanded": {
"type": "string"
},
"description": {
"type": "string"
},
"value": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object"
},
"uniqueItems": true,
"type": "array"
},
"predicate": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object"
}, },
"predicate": { "type": {
"required": [ "type": "array",
"value" "uniqueItems": true,
], "items": {
"properties": { "type": "string",
"expanded": { "enum": [
"type": "string" "org",
}, "user",
"numerical_value": { "attribute",
"type": "number" "event"
}, ]
"description": { }
"type": "string" },
}, "refs": {
"colour": { "type": "array",
"type": "string" "uniqueItems": true,
}, "items": {
"value": { "type": "string"
"type": "string" }
} },
}, "predicates": {
"additionalProperties": false, "$ref": "#/defs/predicates"
"type": "object" },
"values": {
"$ref": "#/defs/values"
} }
}, },
"id": "https://www.github.com/MISP/misp-taxonomies/schema.json", "required": [
"title": "Validator for misp-taxonomies", "namespace",
"$schema": "http://json-schema.org/schema#" "description",
"version",
"predicates"
]
} }