{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/greenlitbooks-com/json-schema/greenlitbooks-com-topic-schema.json",
  "title": "Topic",
  "description": "A curated topic with the catalog resources that cover it.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/greenlitbooks-com-openapi.json#/components/schemas/Topic",
  "type": "object",
  "properties": {
    "slug": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "aliases": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Phrases people use to reach this topic."
    },
    "description": {
      "type": "string"
    },
    "books": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/BookLink"
      }
    },
    "guide": {
      "type": [
        "object",
        "null"
      ],
      "description": "The reading guide covering this topic, when one exists.",
      "properties": {
        "title": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "series": {
      "type": [
        "object",
        "null"
      ],
      "description": "The series dedicated to this topic, when one exists.",
      "properties": {
        "name": {
          "type": "string"
        },
        "slug": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "apiUrl": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  },
  "$defs": {
    "BookLink": {
      "type": "object",
      "description": "Compact pointer to a book, with its reading-order position in its series.",
      "properties": {
        "slug": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "position": {
          "type": "integer",
          "description": "1-based reading order within the series."
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "apiUrl": {
          "type": "string",
          "format": "uri"
        }
      }
    }
  }
}