{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hmcts/json-schema/hmcts-result-code-page-schema.json",
  "title": "result-code-page",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hmcts-result-codes-api-openapi.yml#/components/schemas/result-code-page",
  "allOf": [
    {
      "$ref": "#/$defs/page"
    },
    {
      "properties": {
        "content": {
          "items": {
            "$ref": "#/$defs/result-code-get-summary-dto"
          },
          "type": "array"
        }
      },
      "type": "object"
    }
  ],
  "$defs": {
    "page": {
      "description": "Generic Spring Data page.",
      "properties": {
        "pageNumber": {
          "description": "Zero-based page index.",
          "format": "int32",
          "type": "integer"
        },
        "pageSize": {
          "description": "Page size.",
          "format": "int32",
          "type": "integer"
        },
        "totalElements": {
          "description": "Total number of elements across all pages.",
          "format": "int64",
          "type": "integer"
        },
        "totalPages": {
          "description": "Total number of pages.",
          "format": "int32",
          "type": "integer"
        },
        "sort": {
          "$ref": "#/$defs/sort"
        },
        "first": {
          "type": "boolean"
        },
        "last": {
          "type": "boolean"
        },
        "elementsOnPage": {
          "description": "Total number of elements in the current page.",
          "format": "int32",
          "type": "integer"
        }
      },
      "required": [
        "content",
        "elementsOnPage",
        "pageNumber",
        "pageSize",
        "totalElements"
      ],
      "type": "object"
    },
    "result-code-get-summary-dto": {
      "description": "Lightweight DTO used in list/search views.",
      "properties": {
        "resultCode": {
          "description": "Code that identifies the result.",
          "type": "string"
        },
        "title": {
          "description": "Human-readable title.",
          "type": "string"
        }
      },
      "required": [
        "resultCode",
        "title"
      ],
      "type": "object"
    },
    "sort": {
      "description": "Sorting state for the returned page.",
      "properties": {
        "orders": {
          "description": "Active sort orders in priority order.",
          "items": {
            "$ref": "#/$defs/sort_orders_inner"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "sort_orders_inner": {
      "properties": {
        "property": {
          "description": "Property name used for sorting.",
          "type": "string"
        },
        "direction": {
          "description": "Sort direction.",
          "enum": [
            "asc",
            "desc"
          ],
          "type": "string"
        }
      },
      "required": [
        "direction",
        "property"
      ],
      "type": "object"
    }
  }
}