{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/smartipedia-com/json-schema/smartipedia-com-topic-response-schema.json",
  "title": "TopicResponse",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/smartipedia-com-openapi.json#/components/schemas/TopicResponse",
  "properties": {
    "slug": {
      "type": "string",
      "title": "Slug",
      "description": "URL-safe identifier"
    },
    "title": {
      "type": "string",
      "title": "Title",
      "description": "Human-readable title"
    },
    "summary": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Summary",
      "description": "One-sentence summary"
    },
    "content_md": {
      "type": "string",
      "title": "Content Md",
      "description": "Full article in Markdown"
    },
    "sources": {
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array",
      "title": "Sources",
      "description": "List of {url, title, snippet} citations"
    },
    "infobox": {
      "additionalProperties": true,
      "type": "object",
      "title": "Infobox",
      "description": "Structured key-value facts",
      "default": {}
    },
    "metadata": {
      "additionalProperties": true,
      "type": "object",
      "title": "Metadata",
      "description": "Tags, category, difficulty, quality status",
      "default": {}
    },
    "model_used": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Model Used",
      "description": "LLM model that generated this"
    },
    "revision_number": {
      "type": "integer",
      "title": "Revision Number",
      "description": "Current revision — use for optimistic concurrency"
    },
    "view_count": {
      "type": "integer",
      "title": "View Count",
      "description": "View count"
    },
    "related_topics": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Related Topics",
      "description": "Slugs of related topics",
      "default": []
    },
    "sections": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Sections",
      "description": "Section headings",
      "default": []
    }
  },
  "type": "object",
  "required": [
    "slug",
    "title",
    "summary",
    "content_md",
    "sources",
    "model_used",
    "revision_number",
    "view_count"
  ]
}