{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hmcts/json-schema/hmcts-search-result-view-schema.json",
  "title": "SearchResultView",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hmcts-caseworkers-api-openapi.yml#/components/schemas/SearchResultView",
  "type": "object",
  "properties": {
    "columns": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SearchResultViewColumn"
      }
    },
    "results": {
      "description": "List of result cases. Empty list if no results found.",
      "type": "array",
      "items": {
        "$ref": "#/$defs/SearchResultViewItem"
      }
    }
  },
  "$defs": {
    "SearchResultViewColumn": {
      "type": "object",
      "properties": {
        "case_field_id": {
          "type": "string"
        },
        "case_field_type": {
          "type": "string"
        },
        "label": {
          "type": "string"
        },
        "order": {
          "type": "number",
          "format": "int32"
        }
      }
    },
    "SearchResultViewItem": {
      "type": "object",
      "properties": {
        "case_id": {
          "type": "string"
        },
        "case_fields": {
          "type": "object",
          "description": "A map of case field id and the corresponding case value.",
          "additionalProperties": {
            "type": "object",
            "description": "Values of the fields, type and structure depends on each included field type"
          }
        }
      }
    }
  }
}