{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hmcts/json-schema/hmcts-standard-applicant-page-schema.json",
  "title": "standard-applicant-page",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hmcts-standard-applicants-api-openapi.yml#/components/schemas/standard-applicant-page",
  "allOf": [
    {
      "$ref": "#/$defs/page"
    },
    {
      "properties": {
        "content": {
          "items": {
            "$ref": "#/$defs/standard-applicant-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"
    },
    "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"
    },
    "standard-applicant-get-summary-dto": {
      "description": "Standard Applicant reference data. Only code, name and usage dates are exposed; personal and contact details are excluded.",
      "properties": {
        "code": {
          "description": "Code that identifies the Standard Applicant.",
          "type": "string"
        },
        "name": {
          "description": "Standard Applicant name. Never derived from personal name fields.",
          "type": "string"
        },
        "startDate": {
          "description": "Date the applicant record became active.",
          "format": "date",
          "type": "string"
        },
        "endDate": {
          "description": "Date the applicant record became inactive, or null if still active.",
          "format": "date",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "code",
        "endDate",
        "startDate"
      ],
      "type": "object"
    }
  }
}