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",
"uniqueItems": true,
"items": {
"type": "object",
"additionalProperties": false,
"properties": { "properties": {
"type": { "numerical_value": {
"minItems": 1, "type": "number"
"items": { },
"expanded": {
"type": "string" "type": "string"
}, },
"uniqueItems": true, "description": {
"type": "array"
},
"refs": {
"items": {
"type": "string" "type": "string"
}, },
"uniqueItems": true, "value": {
"type": "array" "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"
}, },
"type": {
"type": "array",
"uniqueItems": true, "uniqueItems": true,
"type": "array" "items": {
"type": "string",
"enum": [
"org",
"user",
"attribute",
"event"
]
}
}, },
"predicate": { "refs": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string" "type": "string"
} }
}, },
"additionalProperties": false, "predicates": {
"type": "object" "$ref": "#/defs/predicates"
},
"values": {
"$ref": "#/defs/values"
}
}, },
"predicate": {
"required": [ "required": [
"value" "namespace",
], "description",
"properties": { "version",
"expanded": { "predicates"
"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#"
} }