{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://redbook.fun/specification/1.0/schemas/taxonomy.schema.json",
  "$defs": {
    "category": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string"
        },
        "parent": {
          "oneOf": [
            {
              "type": "string",
              "minLength": 1
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "required": [
        "id",
        "label",
        "parent"
      ],
      "additionalProperties": false
    },
    "tag": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "minLength": 1
        },
        "label": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "label"
      ],
      "additionalProperties": false
    }
  },
  "oneOf": [
    {
      "$ref": "#/$defs/category"
    },
    {
      "$ref": "#/$defs/tag"
    }
  ]
}
