{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Vulnerability Rating Taxonomy",
    "description": "A Taxonomy of potential vulnerabilities with suggested technical priority rating",
    "definitions": {
        "VRTmetadata": {
            "type": "object",
            "properties": {
                "release_date": {
                    "type": "string",
                    "format": "date-time"
                }
            }
        },
        "VRT": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "pattern": "^[a-z_]*$"
                },
                "type": {
                    "type": "string",
                    "enum": [
                        "category",
                        "subcategory",
                        "variant"
                    ]
                },
                "name": {
                    "type": "string",
                    "pattern": "^[ a-zA-Z0-9-+()/,.<]*$"
                },
                "priority": {
                    "anyOf": [
                        {
                            "type": "number",
                            "minimum": 1,
                            "maximum": 5
                        },
                        {
                            "type": "null"
                        }
                    ]
                }
            },
            "required": [
                "id",
                "name",
                "type",
                "priority"
            ]
        },
        "VRTparent": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "string",
                    "pattern": "^[a-z_]*$"
                },
                "name": {
                    "type": "string",
                    "pattern": "^[ a-zA-Z0-9-+()/,.<]*$"
                },
                "type": {
                    "type": "string",
                    "enum": [
                        "category",
                        "subcategory"
                    ]
                },
                "children": {
                    "type": "array",
                    "items": {
                        "anyOf": [
                            {
                                "$ref": "#/definitions/VRTparent"
                            },
                            {
                                "$ref": "#/definitions/VRT"
                            }
                        ]
                    },
                    "minItems": 1
                }
            },
            "required": [
                "id",
                "name",
                "type",
                "children"
            ]
        }
    },
    "type": "object",
    "required": [
        "metadata",
        "content"
    ],
    "properties": {
        "metadata": {
            "$ref": "#/definitions/VRTmetadata"
        },
        "content": {
            "type": "array",
            "items": {
                "anyOf": [
                    {
                        "$ref": "#/definitions/VRTparent"
                    },
                    {
                        "$ref": "#/definitions/VRT"
                    }
                ]
            }
        }
    }
}