{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openprivacyprotocol.com/schema/0.1/presets.schema.json",
  "title": "OPP industry presets",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "opp",
    "name",
    "version",
    "presets"
  ],
  "properties": {
    "opp": {
      "type": "string",
      "minLength": 1
    },
    "name": {
      "type": "string",
      "minLength": 1
    },
    "version": {
      "type": "string",
      "minLength": 1
    },
    "description": {
      "type": "string"
    },
    "presets": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "label",
          "naics_prefixes",
          "focus_classes"
        ],
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]*$"
          },
          "label": {
            "type": "string",
            "minLength": 1
          },
          "description": {
            "type": "string"
          },
          "naics_prefixes": {
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[0-9]{2,6}$"
            }
          },
          "focus_classes": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "typical_identifiers": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "typical_documents": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        }
      }
    }
  }
}
