{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "definitions": {
    "listItem": {
      "title": "List item",
      "description": "Single list item definition (hierarchical)",
      "type": "object",
      "properties": {
        "value": {
          "title": "Value",
          "description": "Value to be stored in the database",
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "label": {
          "title": "Label",
          "description": "User-friendly label",
          "type": "string",
          "minLength": 1
        },
        "inactive": {
          "title": "Inactive",
          "description": "Whether or not the item is active",
          "type": "boolean",
          "default": false
        },
        "children": {
          "title": "List item children",
          "description": "Direct children items of the current list item",
          "type": "array",
          "items": {
            "allOf": [
              {
                "$ref": "#/definitions/listItem"
              }
            ]
          }
        }
      },
      "additionalProperties": false,
      "required": [
        "value",
        "label",
        "inactive",
        "children"
      ]
    }
  },
  "title": "CSV List Configuration",
  "description": "List items configuration for a single CSV list",
  "type": "object",
  "properties": {
    "items": {
      "title": "List items",
      "description": "A list of items for a given list",
      "type": "array",
      "items": {
        "allOf": [
          {
            "$ref": "#/definitions/listItem"
          }
        ]
      },
      "minItems": 1,
      "_uniqueItems": true
    }
  },
  "additionalProperties": false,
  "required": [
    "items"
  ]
}