{
  "$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": ["comic_id", "page_number", "image_url"],
  "properties": {
    "comic_id": {
      "type": "string",
      "description": "ID of the parent comic.",
      "example": "mycomic"
    },
    "page_number": {
      "type": "integer",
      "description": "1-indexed position within the comic's archive. A comic's pages are numbered 1 to total_pages with no gaps, so the previous page is page_number − 1 and the next is page_number + 1.",
      "example": 1
    },
    "title": {
      "type": ["string", "null"],
      "description": "Page title from the source site, if any.",
      "example": "Act 1. Pg 001"
    },
    "url": {
      "type": ["string", "null"],
      "format": "uri",
      "description": "Canonical URL of the page on the source website. Optional — not all webcomic platforms provide per-page addressable URLs.",
      "example": "https://www.mycomic.com/comic/1"
    },
    "image_url": {
      "type": "string",
      "format": "uri",
      "description": "Direct URL of the page's image asset.",
      "example": "https://www.mycomic.com/images/001.jpg"
    },
    "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."
    },
    "group_id": {
      "type": ["string", "null"],
      "description": "Identifier of the group (chapter/act/arc) this page belongs to, if any.",
      "example": "act-1"
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "comic_id": "mycomic",
      "page_number": 1,
      "title": "Act 1. Pg 001",
      "url": "https://www.mycomic.com/comic/1",
      "image_url": "https://www.mycomic.com/images/001.jpg",
      "group_id": "act-1"
    }
  ]
}
