{

"$schema": "http://json-schema.org/draft-04/schema#",
"title": "VRT Taxonomy",
"description": "VRT",
"definitions": {
  "VRTmetadata": {
    "type": "object",
    "properties": {
      "release_date":   { "type": "string", "format": "date-time" }
    }
  },
  "VRT": {
    "type": "object",
    "properties": {
      "id":             { "type": "string", "pattern": "^[a-z_][a-z_0-9]*$" },
      "type":           { "type": "string", "enum": [ "category", "subcategory", "variant" ] },
      "name":           { "type": "string" },
      "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_][a-z_0-9]*$" },
      "name":           { "type": "string" },
      "type":           { "type": "string", "enum": [ "category", "subcategory" ] },
      "children": {
        "type": "array",
        "items" : {
          "anyOf": [
            { "$ref": "#/definitions/VRTparent" },
            { "$ref": "#/definitions/VRT" }
          ]
        }
      }
    },
    "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" }
      ]
    }
  }
}

}