{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/quotewise-io/json-schema/quotewise-io-curation-quote-create-request-schema.json",
  "title": "CurationQuoteCreateRequest",
  "description": "Reject unknown top-level body keys instead of silently dropping them.\n\nDRF ignores unrecognised keys by default. On a curation mutation that is a\ntrap: ``curation-sighting-create --body-file '{\"source_id\": 1366}'`` returned a\nclean envelope while dropping ``source_id``, so the curator believed a source\nwas attached when the sighting landed sourceless. A typo in a ``--body-file``\nfails the same silent way.\n\nThe ``changes``-dict endpoints already reject unknown keys explicitly; this\nextends the same contract to the flat-body verbs.\n\nSubclasses may map a field to a bespoke message via ``unknown_field_hints``\nwhen the caller's intent is obvious and there is a right way to do it.",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/quotewise-io-openapi.yml#/components/schemas/CurationQuoteCreateRequest",
  "type": "object",
  "properties": {
    "auto_citation": {
      "type": "boolean",
      "default": true,
      "description": "Derive citation_json from the URL and anchor a YouTube quote in its cached transcript. Explicit citation_json keys win. citation_json.newsletter_date sets platform NL."
    },
    "create_channel_source": {
      "type": "boolean",
      "default": false,
      "description": "Find or create the channel-level Source from YouTube channel metadata and link it. Without this, an existing channel Source is still linked when no source_id is given."
    },
    "podcast": {
      "allOf": [
        {
          "$ref": "#/$defs/CurationPodcastRequest"
        }
      ],
      "description": "With create_channel_source: type a newly created channel Source as a podcast. An existing Source is linked unchanged."
    },
    "text": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4000
    },
    "originator_id": {
      "type": "integer"
    },
    "originator_slug": {
      "type": "string",
      "minLength": 1,
      "maxLength": 255
    },
    "source_id": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Omit or null for a sourceless channel-only sighting (tweet, post)."
    },
    "sighting_url": {
      "type": "string",
      "format": "uri",
      "minLength": 1,
      "maxLength": 512
    },
    "citation_json": {
      "type": "object",
      "additionalProperties": {}
    },
    "attribution_kind": {
      "enum": [
        "DIRECT",
        "ATTRIBUTED",
        "MISATTRIBUTION",
        "POPULARIZED",
        "PARAPHRASED",
        "DISPUTED",
        "TRADITIONAL",
        "APOCRYPHAL",
        "DIGITAL_APOCRYPHA"
      ],
      "type": "string",
      "x-spec-enum-id": "63cfca372d76167e",
      "default": "DIRECT",
      "description": "APOCRYPHAL, DIGITAL_APOCRYPHA, DISPUTED and MISATTRIBUTION compose only on a newly created quote: the quote is created DIRECT and immediately flipped by its structural moderation operation in one transaction, with attribution_reason as the flip reason. A duplicate text+originator with a composed kind is rejected (409), not silently ignored and not flipped, unless the existing quote already has that same composed kind.\n\n* `DIRECT` - DIRECT\n* `ATTRIBUTED` - ATTRIBUTED\n* `MISATTRIBUTION` - MISATTRIBUTION\n* `POPULARIZED` - POPULARIZED\n* `PARAPHRASED` - PARAPHRASED\n* `DISPUTED` - DISPUTED\n* `TRADITIONAL` - TRADITIONAL\n* `APOCRYPHAL` - APOCRYPHAL\n* `DIGITAL_APOCRYPHA` - DIGITAL_APOCRYPHA"
    },
    "correct_quote": {
      "type": [
        "string",
        "null"
      ],
      "description": "Required for MISATTRIBUTION: short code of the correctly attributed quote."
    },
    "popularizes_quote": {
      "type": [
        "string",
        "null"
      ],
      "description": "POPULARIZED only: short code of the canonical quote popularized by this new copy."
    },
    "rival_claimant_slug": {
      "type": "string",
      "minLength": 1,
      "description": "DISPUTED only: slug of the rival originator; the new quote's originator stays the traditional claimant."
    },
    "attribution_reason": {
      "type": "string",
      "minLength": 1
    },
    "evidence": {
      "$ref": "#/$defs/CurationCreateEvidenceRequest"
    },
    "negative_search_note": {
      "type": "string",
      "minLength": 1,
      "description": "APOCRYPHAL / DIGITAL_APOCRYPHA only: what was searched. Attached as negative_search evidence when the quote is newly created."
    },
    "quote_date": {
      "type": "string",
      "minLength": 1,
      "maxLength": 50
    },
    "quote_date_approximate": {
      "type": "boolean",
      "default": false,
      "description": "Requires quote_date."
    },
    "tags": {
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1
      },
      "description": "Topic tags to attach. A banned or conflicting tag rejects the whole request."
    },
    "framing": {
      "type": "string",
      "default": "",
      "description": "Compact thematic label for the quote (Quote.framing).",
      "maxLength": 100
    },
    "circumstance": {
      "type": "string",
      "default": "",
      "description": "Factual situation the quote was uttered in (Quote.circumstance).",
      "maxLength": 288
    },
    "language_code": {
      "type": "string",
      "minLength": 1,
      "maxLength": 10
    },
    "canonical_over": {
      "type": [
        "string",
        "null"
      ],
      "description": "Short code of the near-match candidate this text replaces as canonical: the curator examined the primary, the submitted text is its wording, and the candidate is an inexact circulating form. Requires primary_source evidence with examined=true, a method, and a passing match tier."
    },
    "old_relation": {
      "enum": [
        "variant",
        "excerpt_of"
      ],
      "type": "string",
      "x-spec-enum-id": "f2c63df2b851a018",
      "description": "canonical_over only: how the old row relates to the new one. Defaults from Jev's class.\n\n* `variant` - variant\n* `excerpt_of` - excerpt_of"
    },
    "old_kind": {
      "enum": [
        "PARAPHRASED"
      ],
      "type": "string",
      "x-spec-enum-id": "934ce0bbb8ea7e44",
      "description": "canonical_over only: flip the old row's attribution kind. Unchanged when omitted.\n\n* `PARAPHRASED` - PARAPHRASED"
    },
    "canonical_over_mode": {
      "enum": [
        "strict",
        "link_existing",
        "create_plain"
      ],
      "type": "string",
      "x-spec-enum-id": "190c56c0e9057970",
      "default": "strict",
      "description": "canonical_over only: what to do when canonical_over is not the text's near-match. strict (default) refuses. link_existing: when the text exactly matches a stored quote, reuse it as the canonical (sighting + evidence attach to it) and demote the old row under it. create_plain: also, when nothing or another quote near-matches, create the text without canonical_over and demote the old row under it. Re-runs converge: an old row already demoted under the result only gets old_kind. The response's canonical_over_path says which ran: promoted | linked_existing | created_plain | needs_review.\n\n* `strict` - strict\n* `link_existing` - link_existing\n* `create_plain` - create_plain"
    },
    "variant_of": {
      "type": [
        "string",
        "null"
      ],
      "description": "Short code of the canonical quote this text is a variant of: the curator's decision, so the near-match review is skipped. The row, sighting, evidence and relation land together."
    },
    "excerpt_of": {
      "type": [
        "string",
        "null"
      ],
      "description": "Short code of the fuller quote this text is an excerpt of. Otherwise as variant_of."
    },
    "dry_run": {
      "type": "boolean",
      "default": false
    }
  },
  "required": [
    "attribution_reason",
    "sighting_url",
    "text"
  ],
  "$defs": {
    "CurationCreateEvidenceRequest": {
      "type": "object",
      "description": "Reject unknown top-level body keys instead of silently dropping them.\n\nDRF ignores unrecognised keys by default. On a curation mutation that is a\ntrap: ``curation-sighting-create --body-file '{\"source_id\": 1366}'`` returned a\nclean envelope while dropping ``source_id``, so the curator believed a source\nwas attached when the sighting landed sourceless. A typo in a ``--body-file``\nfails the same silent way.\n\nThe ``changes``-dict endpoints already reject unknown keys explicitly; this\nextends the same contract to the flat-body verbs.\n\nSubclasses may map a field to a bespoke message via ``unknown_field_hints``\nwhen the caller's intent is obvious and there is a right way to do it.",
      "properties": {
        "role": {
          "enum": [
            "earliest_known",
            "primary_source",
            "corroborating",
            "refuting",
            "propagation_artifact",
            "negative_search"
          ],
          "type": "string",
          "description": "* `earliest_known` - Earliest known\n* `primary_source` - Primary source\n* `corroborating` - Corroborating\n* `refuting` - Refuting\n* `propagation_artifact` - Propagation Artifact\n* `negative_search` - Negative search",
          "x-spec-enum-id": "e40bec97b37e64c0"
        },
        "note": {
          "type": "string",
          "default": ""
        },
        "verification": {
          "type": "object",
          "additionalProperties": {}
        }
      },
      "required": [
        "role"
      ]
    },
    "CurationPodcastRequest": {
      "type": "object",
      "description": "Reject unknown top-level body keys instead of silently dropping them.\n\nDRF ignores unrecognised keys by default. On a curation mutation that is a\ntrap: ``curation-sighting-create --body-file '{\"source_id\": 1366}'`` returned a\nclean envelope while dropping ``source_id``, so the curator believed a source\nwas attached when the sighting landed sourceless. A typo in a ``--body-file``\nfails the same silent way.\n\nThe ``changes``-dict endpoints already reject unknown keys explicitly; this\nextends the same contract to the flat-body verbs.\n\nSubclasses may map a field to a bespoke message via ``unknown_field_hints``\nwhen the caller's intent is obvious and there is a right way to do it.",
      "properties": {
        "show_name": {
          "type": "string",
          "minLength": 1
        },
        "show_url": {
          "type": [
            "string",
            "null"
          ],
          "format": "uri",
          "minLength": 1
        },
        "publisher": {
          "type": [
            "string",
            "null"
          ],
          "minLength": 1,
          "description": "Defaults to the YouTube channel."
        }
      },
      "required": [
        "show_name"
      ]
    }
  }
}