{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ucp.dev/2026-08-25/schemas/common/types/pagination.json",
  "title": "Pagination",
  "description": "Cursor-based pagination for list operations.",
  "type": "object",
  "$defs": {
    "request": {
      "type": "object",
      "description": "Pagination parameters for requests.",
      "properties": {
        "cursor": {
          "type": "string",
          "description": "Opaque cursor from previous response."
        },
        "limit": {
          "type": "integer",
          "minimum": 1,
          "description": "Requested page size, not a guaranteed result count. When omitted, the Business MUST apply a default page size. A default of 10 is RECOMMENDED, but the Business MAY choose another value. The Business MAY return fewer results than the requested or default page size, including when enforcing its maximum page size. A Platform MUST NOT assume that the response count equals either value."
        }
      }
    },
    "response": {
      "type": "object",
      "description": "Pagination information in responses.",
      "properties": {
        "cursor": {
          "type": "string",
          "description": "Cursor to fetch the next page of results. MUST be present when has_next_page is true."
        },
        "has_next_page": {
          "type": "boolean",
          "description": "Whether more results are available."
        },
        "total_count": {
          "type": "integer",
          "minimum": 0,
          "description": "Total number of matching items, if available."
        }
      },
      "required": [
        "has_next_page"
      ],
      "if": {
        "properties": {
          "has_next_page": {
            "const": true
          }
        },
        "required": [
          "has_next_page"
        ]
      },
      "then": {
        "required": [
          "cursor"
        ]
      }
    }
  }
}