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