{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://openwebcomics.comicopia.app/schema/comic-page.schema.json",
  "title": "ComicPage",
  "description": "A single indexed page from a comic archive.",
  "type": "object",
  "required": ["id", "comic_id", "page_number", "image_url"],
  "properties": {
    "id": {
      "type": "integer",
      "description": "Auto-incrementing database ID.",
      "example": 1
    },
    "comic_id": {
      "type": "string",
      "description": "ID of the parent comic.",
      "example": "drivecomic"
    },
    "page_number": {
      "type": "integer",
      "description": "1-indexed position within the comic's archive.",
      "example": 1
    },
    "title": {
      "type": ["string", "null"],
      "description": "Page title as scraped from the source site.",
      "example": "Act 1. Pg 001"
    },
    "url": {
      "type": ["string", "null"],
      "format": "uri",
      "description": "Canonical URL of the page on the source website."
    },
    "image_url": {
      "type": "string",
      "format": "uri",
      "description": "Direct URL of the page's image asset."
    },
    "alt_text": {
      "type": ["string", "null"],
      "description": "Alt text or hover text from the source site, if available."
    },
    "published_at": {
      "type": ["string", "null"],
      "format": "date-time",
      "description": "ISO 8601 publication timestamp, if available from the source site."
    },
    "scraped_at": {
      "type": ["string", "null"],
      "format": "date-time",
      "description": "ISO 8601 timestamp when this page was indexed."
    },
    "group_id": {
      "type": ["string", "null"],
      "description": "Identifier of the group (chapter/act/arc) this page belongs to, if any."
    },
    "prev_page": {
      "type": ["integer", "null"],
      "description": "Page number of the previous page, or null if this is the first page. Only present on the single-page endpoint."
    },
    "next_page": {
      "type": ["integer", "null"],
      "description": "Page number of the next page, or null if this is the last page. Only present on the single-page endpoint."
    }
  },
  "additionalProperties": false
}
