{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/quotewise-io/json-schema/quotewise-io-curation-source-schema.json",
  "title": "CurationSource",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/quotewise-io-openapi.yml#/components/schemas/CurationSource",
  "type": "object",
  "properties": {
    "id": {
      "type": "integer",
      "readOnly": true
    },
    "source_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Concise name of the source (e.g., book title, speech name, website name).",
      "maxLength": 255
    },
    "source_name_complete": {
      "type": [
        "string",
        "null"
      ],
      "description": "Complete name of the source (e.g., book title, speech name, website name).",
      "maxLength": 255
    },
    "source_url": {
      "nullable": true,
      "description": "URL or reference to the original source.",
      "oneOf": [
        {
          "type": "string",
          "format": "uri",
          "maxLength": 512
        },
        {
          "type": "string",
          "maxLength": 0
        }
      ]
    },
    "source_type": {
      "enum": [
        "article",
        "book",
        "broadcast",
        "comic",
        "document",
        "essay",
        "legal_case",
        "legislation",
        "letter",
        "interview",
        "academic_journal",
        "personal_journal",
        "magazine",
        "motion_picture",
        "news",
        "newsletter",
        "newspaper",
        "poem",
        "podcast",
        "qrawled",
        "social_media",
        "software",
        "song",
        "album",
        "speech",
        "video",
        "website"
      ],
      "type": "string",
      "x-spec-enum-id": "3def90f1d21ca1ba",
      "description": "Type of source (e.g., 'Book', 'Speech', 'Article', 'Interview', 'Social Media', 'Qrawled').\n\n* `article` - Article\n* `book` - Book\n* `broadcast` - TV / Radio\n* `comic` - Comic\n* `document` - Document\n* `essay` - Essay\n* `legal_case` - Court Case\n* `legislation` - Statute\n* `letter` - Letter\n* `interview` - Interview\n* `academic_journal` - Academic Journal\n* `personal_journal` - Personal Journal\n* `magazine` - Magazine\n* `motion_picture` - Film\n* `news` - News\n* `newsletter` - Newsletter\n* `newspaper` - Newspaper\n* `poem` - Poem\n* `podcast` - Podcast\n* `qrawled` - Qrawled\n* `social_media` - Social Media\n* `software` - Software\n* `song` - Song\n* `album` - Album\n* `speech` - Speech\n* `video` - Video\n* `website` - Website"
    },
    "language": {
      "type": "string",
      "description": "Language code of the Source's language FK; null when unset. Writable via PATCH changes.language.",
      "readOnly": true
    },
    "canonical_csl": {},
    "creation_metadata": {
      "description": "Creation decision chain and justification including deduplication gates and creation reasoning"
    },
    "publication_date": {
      "type": [
        "string",
        "null"
      ],
      "format": "date",
      "description": "Date of publication or creation of the source."
    },
    "publisher": {
      "type": [
        "string",
        "null"
      ],
      "description": "Publisher or platform of the source.",
      "maxLength": 255
    },
    "isbn": {
      "type": [
        "string",
        "null"
      ],
      "description": "The International Standard Book Number (ISBN) for the book.",
      "maxLength": 17
    },
    "isbn13": {
      "type": [
        "string",
        "null"
      ],
      "description": "The 13-digit ISBN for the book. All ISBNs issued after January 1, 2007 use this format.",
      "maxLength": 17
    },
    "asin": {
      "type": [
        "string",
        "null"
      ],
      "description": "The Amazon Standard Identification Number (ASIN) for the book.",
      "maxLength": 10
    },
    "ocaid": {
      "nullable": true,
      "description": "Internet Archive item identifier (OCAID) for the scanned edition, e.g. 'basedontruestory0000macd'. Powers the archive.org verification link.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{2,99}$",
          "maxLength": 100
        },
        {
          "type": "string",
          "maxLength": 0
        }
      ]
    },
    "ol_work_id": {
      "nullable": true,
      "description": "Open Library work OLID, e.g. 'OL17597569W'. Operational re-discovery handle for get_editions(work); not user-facing.",
      "oneOf": [
        {
          "type": "string",
          "pattern": "^OL\\d+W$",
          "maxLength": 64
        },
        {
          "type": "string",
          "maxLength": 0
        }
      ]
    },
    "book_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Unique identifier for the book from the online reference.",
      "maxLength": 255
    },
    "best_book_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Best Unique identifier for the book from the online reference.",
      "maxLength": 255
    },
    "footnote": {
      "type": [
        "boolean",
        "null"
      ],
      "description": "Whether the source is un-confirmed URL."
    },
    "is_compendium": {
      "type": "boolean",
      "description": "Whether this is a compendium/anthology (e.g., 'Wit and Wisdom of X'). Compendium sources are hidden from user browsing."
    },
    "is_private": {
      "type": "boolean",
      "description": "Private/confidential source — never named on any user-facing surface; protects the contributor relationship regardless of copyright status."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "description": "Timestamp of when the record was created."
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "description": "Timestamp of when the record was last updated."
    }
  },
  "required": [
    "created_at",
    "id",
    "language",
    "source_type",
    "updated_at"
  ]
}