{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coderpad/json-schema/coderpad-questions-page-schema.json",
  "title": "questions_page",
  "description": "Paginated list of questions",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coderpad-questions-api-openapi.yml#/components/schemas/questions_page",
  "type": "object",
  "properties": {
    "questions": {
      "type": "array",
      "description": "the questions of the current page",
      "items": {
        "$ref": "#/$defs/QuestionsResult"
      }
    },
    "pagination": {
      "$ref": "#/$defs/pagination_config"
    }
  },
  "$defs": {
    "QuestionsResult": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "the question id",
          "format": "uuid"
        },
        "version": {
          "type": "integer",
          "description": "the question version",
          "format": "int32"
        },
        "title": {
          "type": "object",
          "additionalProperties": {
            "type": "string",
            "description": "the question title, by locale"
          },
          "description": "the question title, by locale"
        },
        "type": {
          "type": "string",
          "description": "the question type",
          "enum": [
            "MCQ",
            "CODE",
            "TEXT",
            "MULTI",
            "GAME",
            "CLASH",
            "COURSE",
            "FILE_UPLOAD",
            "PROJECT",
            "VIDEO"
          ]
        },
        "difficulty": {
          "type": "string",
          "description": "difficulty level",
          "enum": [
            "EASY",
            "MEDIUM",
            "HARD"
          ]
        },
        "domain": {
          "type": "string",
          "description": "the question domain name"
        },
        "skill": {
          "type": "string",
          "description": "the question skill"
        },
        "product": {
          "type": "string",
          "description": "the product the question belongs to",
          "enum": [
            "SCREEN",
            "QUALIFY"
          ]
        },
        "duration_seconds": {
          "type": "integer",
          "description": "the question duration in seconds",
          "format": "int32"
        },
        "programming_language_id": {
          "type": "string",
          "description": "the programming language id; absent when the question is not tied to a single language"
        },
        "modification_time": {
          "type": "string",
          "description": "last modification time of the question, in UTC"
        },
        "from_coderpad_question_bank": {
          "type": "boolean",
          "description": "true if the question comes from the CoderPad question bank"
        }
      },
      "description": "Summary of a question"
    },
    "pagination_config": {
      "type": "object",
      "properties": {
        "start": {
          "type": [
            "integer",
            "null"
          ],
          "description": "the first element to pick, null when the page was requested with a cursor",
          "format": "int32"
        },
        "limit": {
          "type": "integer",
          "description": "the maximum number of elements returned",
          "format": "int32"
        },
        "total": {
          "type": "integer",
          "description": "the total number of available elements",
          "format": "int32"
        },
        "has_more_items": {
          "type": "boolean",
          "description": "true if there are still some elements to be fetched"
        },
        "next_start": {
          "type": [
            "integer",
            "null"
          ],
          "description": "if has_more_items is true, point to the first element of the next page, null when the page was requested with a cursor",
          "format": "int32"
        },
        "next_cursor": {
          "type": "string",
          "description": "if has_more_items is true, the cursor to send to fetch the next page, on the endpoints that support it"
        },
        "next_page": {
          "type": "string",
          "description": "if has_more_items is true, the URL of the next page: the query parameters of the current page with the next cursor, on the endpoints that support it"
        }
      },
      "description": "the pagination config"
    }
  }
}