{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://openwebcomics.comicopia.app/schema/comic.schema.json",
  "title": "Comic",
  "description": "A comic series available from an Open Web Comics registry.",
  "type": "object",
  "required": ["id", "name", "url", "canonical_id", "total_pages"],
  "properties": {
    "id": {
      "type": "string",
      "description": "Unique identifier for the comic (slug-style).",
      "example": "mycomic"
    },
    "name": {
      "type": "string",
      "description": "Display name of the comic.",
      "example": "My Comic"
    },
    "description": {
      "type": ["string", "null"],
      "description": "Short description or tagline for the comic."
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Canonical URL of the comic's website.",
      "example": "https://www.mycomic.com"
    },
    "logo_url": {
      "type": ["string", "null"],
      "format": "uri",
      "description": "URL of the comic's logo image."
    },
    "canonical_id": {
      "type": "string",
      "description": "SHA-256 hash of the normalized first-page image URL. Used for stable cross-registry comic identity. See https://openwebcomics.comicopia.app/docs/canonical-id/ for the algorithm.",
      "example": "a3f5d8e2b1c4f6d9e0a2b3c5d7e8f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6"
    },
    "total_pages": {
      "type": "integer",
      "minimum": 0,
      "description": "Number of pages in the comic. Must equal the number of pages returned by GET /comics/{comicId}/pages.",
      "example": 487
    },
    "bluesky_url": {
      "type": ["string", "null"],
      "description": "Creator's Bluesky profile URL. Not format-validated as social media URLs may contain browser-style unencoded characters."
    },
    "patreon_url": {
      "type": ["string", "null"],
      "description": "Creator's Patreon page URL. Not format-validated as social media URLs may contain browser-style unencoded characters."
    },
    "self_cert_rating": {
      "enum": ["everyone", "teen", "adult", null],
      "description": "Self-certified content rating, asserted by the comic's author and NOT verified by any registry. 'everyone' = suitable for all ages; 'teen' = mild mature themes; 'adult' = explicit/NSFW. Optional and nullable: omit the property or set it to null when unrated. Clients MUST treat a comic with an absent or null rating as 'adult'.",
      "example": "everyone"
    },
    "created_at": {
      "type": ["string", "null"],
      "format": "date-time",
      "description": "ISO 8601 timestamp when this comic was added to the registry."
    }
  },
  "additionalProperties": false,
  "examples": [
    {
      "id": "mycomic",
      "name": "My Comic",
      "url": "https://www.mycomic.com",
      "canonical_id": "a3f5d8e2b1c4f6d9e0a2b3c5d7e8f0a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
      "description": "An ongoing adventure series.",
      "logo_url": "https://www.mycomic.com/logo.png",
      "total_pages": 487,
      "self_cert_rating": "everyone"
    }
  ]
}
