{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/overfit-de/json-schema/overfit-de-question-schema.json",
  "title": "Question",
  "x-generated": "2026-11-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/overfit-de-openapi.json#/components/schemas/Question",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "question": {
      "type": "string",
      "minLength": 1,
      "title": "Question"
    },
    "time_created": {
      "type": "string",
      "format": "date-time",
      "title": "Time Created"
    },
    "question_steps": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/QuestionStep"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Question Steps"
    },
    "insight_id": {
      "type": "string",
      "title": "Insight Id"
    },
    "result": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Result"
    },
    "question_type": {
      "$ref": "#/$defs/QuestionTypes"
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "sources": {
      "items": {
        "$ref": "#/$defs/Source"
      },
      "type": "array",
      "title": "Sources",
      "default": []
    },
    "sub": {
      "type": "string",
      "format": "uuid",
      "title": "Sub"
    },
    "length": {
      "type": "integer",
      "title": "Length"
    },
    "source_snippets": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/SourceSnippet"
          },
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source Snippets"
    }
  },
  "type": "object",
  "required": [
    "id",
    "question",
    "time_created",
    "insight_id",
    "result",
    "question_type",
    "status",
    "sub",
    "length"
  ],
  "$defs": {
    "QuestionStep": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "question_id": {
          "type": "string",
          "title": "Question Id"
        },
        "order": {
          "type": "integer",
          "title": "Order"
        },
        "step_type": {
          "type": "string",
          "title": "Step Type"
        },
        "step_message": {
          "type": "string",
          "title": "Step Message"
        }
      },
      "type": "object",
      "required": [
        "id",
        "question_id",
        "order",
        "step_type",
        "step_message"
      ],
      "title": "QuestionStep"
    },
    "QuestionTypes": {
      "type": "string",
      "enum": [
        "SUMMARY",
        "AGENT",
        "HYBRID",
        "FULL_TEXT",
        "FULL_TEXT_EXACT"
      ],
      "title": "QuestionTypes"
    },
    "Source": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Name"
        },
        "description": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Description"
        },
        "insight_id": {
          "type": "string",
          "title": "Insight Id"
        },
        "time_created": {
          "type": "string",
          "format": "date-time",
          "title": "Time Created"
        },
        "source_type": {
          "$ref": "#/$defs/SourceTypes"
        },
        "public": {
          "type": "boolean",
          "title": "Public",
          "default": false
        },
        "keywords": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Keywords"
        },
        "path": {
          "type": "string",
          "title": "Path"
        },
        "length": {
          "type": "integer",
          "title": "Length"
        }
      },
      "type": "object",
      "required": [
        "id",
        "insight_id",
        "time_created",
        "source_type",
        "path",
        "length"
      ],
      "title": "Source"
    },
    "SourceSnippet": {
      "properties": {
        "source_id": {
          "type": "string",
          "title": "Source Id"
        },
        "snippet_id": {
          "type": "string",
          "title": "Snippet Id"
        },
        "snippet": {
          "type": "string",
          "title": "Snippet"
        },
        "score": {
          "type": "number",
          "title": "Score",
          "default": 0.0
        }
      },
      "type": "object",
      "required": [
        "source_id",
        "snippet_id",
        "snippet"
      ],
      "title": "SourceSnippet"
    },
    "SourceTypes": {
      "type": "string",
      "enum": [
        "WEBSITE",
        "REMOTE_DOCUMENT",
        "SEARCH",
        "DOCUMENT_UPLOAD"
      ],
      "title": "SourceTypes"
    }
  }
}