{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vaquill-ai/json-schema/vaquill-ai-document-summary-schema.json",
  "title": "DocumentSummary",
  "description": "What was persisted the last time this document was summarized.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vaquill-ai-documents-api-openapi.yml#/components/schemas/DocumentSummary",
  "properties": {
    "documentId": {
      "type": "string",
      "title": "Documentid",
      "description": "`doc_` identifier of the document this summarizes."
    },
    "overview": {
      "type": "string",
      "title": "Overview",
      "description": "The whole-document summary, a few paragraphs of prose. Empty string when the summary was stored with sections only."
    },
    "sections": {
      "items": {
        "$ref": "#/$defs/SummarySection"
      },
      "type": "array",
      "title": "Sections",
      "description": "Section-by-section summaries, in document order. Empty when the document was short enough to summarize in one pass."
    },
    "documentCategory": {
      "type": "string",
      "title": "Documentcategory",
      "description": "How the summarizer classified the document, for example `contract` or `general`. Published as a plain string; do not branch on it without a fallback."
    },
    "pageCount": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Pagecount",
      "description": "Pages the summarizer read. Absent on older rows."
    },
    "length": {
      "type": "string",
      "title": "Length",
      "description": "Which length this summary was produced at: `short`, `medium` or `long`. Published as a plain string for the same reason as `documentCategory`."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time",
      "title": "Createdat",
      "description": "When the summary was produced (RFC 3339)."
    },
    "updatedAt": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Updatedat",
      "description": "When the summary was last regenerated (RFC 3339)."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "documentId",
    "overview",
    "documentCategory",
    "length",
    "createdAt"
  ],
  "$defs": {
    "SummarySection": {
      "properties": {
        "title": {
          "type": "string",
          "title": "Title",
          "description": "Heading for this part of the summary.",
          "default": ""
        },
        "content": {
          "type": "string",
          "title": "Content",
          "description": "The summary text under this heading.",
          "default": ""
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "SummarySection",
      "description": "One heading of the summary.\n\n`content` is loose on purpose. `document_summaries.sections` is JSONB\nwritten by a service this API does not own, and the shape has changed once\nalready; a closed model here would answer 500 for whoever owns the older\nrows, which is the same reasoning that keeps every publisher-controlled\nvocabulary on this surface a plain `str` outbound."
    }
  }
}