{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hmcts/json-schema/hmcts-case-tab-collection-schema.json",
  "title": "CaseTabCollection",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hmcts-display-api-openapi.yml#/components/schemas/CaseTabCollection",
  "type": "object",
  "properties": {
    "case_type_id": {
      "type": "string",
      "description": "Unique identifier for a Case Type."
    },
    "channels": {
      "type": "array",
      "description": "The channels this tab is targetted at",
      "items": {
        "type": "string"
      }
    },
    "tabs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CaseTypeTab"
      }
    }
  },
  "required": [
    "case_type_id",
    "tabs"
  ],
  "$defs": {
    "CaseField": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The id of the case field"
        },
        "case_type_id": {
          "type": "string",
          "description": "Foriegn key to the case type as fields should not work across"
        },
        "label": {
          "type": "string"
        },
        "hint_text": {
          "type": "string"
        },
        "field_type": {
          "$ref": "#/$defs/FieldType"
        },
        "hidden": {
          "type": "boolean"
        },
        "validation_expr": {
          "type": "string"
        },
        "security_label": {
          "type": "string",
          "description": "Gov security level of the data (official, top secret etc)"
        },
        "live_from": {
          "type": "string"
        },
        "live_until": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "label",
        "field_type"
      ]
    },
    "CaseTypeTab": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "order": {
          "type": "integer",
          "format": "int32"
        },
        "tab_fields": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/CaseTypeTabField"
          }
        }
      }
    },
    "CaseTypeTabField": {
      "type": "object",
      "properties": {
        "case_field": {
          "$ref": "#/$defs/CaseField"
        },
        "order": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "FieldType": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        }
      }
    }
  }
}