{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/the-trivia-api-com/json-schema/the-trivia-api-com-text-choice-question-schema.json",
  "title": "TextChoiceQuestion",
  "x-generated": "2026-11-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/the-trivia-api-com-openapi.yml#/components/schemas/TextChoiceQuestion",
  "allOf": [
    {
      "$ref": "#/$defs/BaseQuestion"
    },
    {
      "type": "object",
      "properties": {
        "question": {
          "type": "object",
          "properties": {
            "text": {
              "type": "string",
              "description": "String formulation of the questions"
            }
          },
          "required": [
            "text"
          ]
        },
        "correctAnswer": {
          "type": "string",
          "description": "The correct answer"
        },
        "incorrectAnswers": {
          "type": "array",
          "description": "Array of incorrect answers",
          "items": {
            "type": "string",
            "description": "An incorrect answer"
          }
        },
        "hint": {
          "type": "string",
          "description": "A one-sentence clue to show before the player answers, if they ask for one. It points towards the answer without giving it away. Optional: not every question has one yet, and it is currently only returned for English requests."
        },
        "explanation": {
          "type": "string",
          "description": "One or two sentences to show after the player answers, saying why the correct answer is right or adding a related fact. It names the correct answer, so do not show it before the player has answered. Optional: not every question has one yet, and it is currently only returned for English requests."
        },
        "type": {
          "type": "string",
          "enum": [
            "text_choice"
          ]
        }
      },
      "required": [
        "question",
        "correctAnswer",
        "incorrectAnswers",
        "type"
      ]
    }
  ],
  "$defs": {
    "BaseQuestion": {
      "type": "object",
      "properties": {
        "category": {
          "type": "string",
          "$ref": "#/$defs/Category"
        },
        "id": {
          "type": "string",
          "description": "Unique identifier for the question"
        },
        "tags": {
          "type": "array",
          "description": "Secondary categories for the question. More freeform than category (can take any value), and can have multiple tags per question.",
          "items": {
            "type": "string"
          }
        },
        "difficulty": {
          "type": "string",
          "enum": [
            "easy",
            "medium",
            "hard"
          ],
          "description": "How difficult the question is perceived to be by the moderators of the API."
        },
        "regions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "If the question is regional (i.e. only reasonable to ask people from a particular set of countries), then the ISO 3166-1 alpha-2 country codes for those countries are specified here.\n\nFor most questions, this will be an empty array, meaning that the question is suitable to ask to people from anywhere in the world."
        },
        "isNiche": {
          "type": "boolean",
          "description": "Will be true if the question is a niche question, i.e. if it is considered too difficult to return unless the tag is specifically requested."
        }
      },
      "required": [
        "category",
        "id",
        "tags",
        "isNiche",
        "difficulty"
      ]
    },
    "Category": {
      "type": "string",
      "enum": [
        "music",
        "sport_and_leisure",
        "film_and_tv",
        "arts_and_literature",
        "history",
        "society_and_culture",
        "science",
        "geography",
        "food_and_drink",
        "general_knowledge"
      ]
    }
  }
}