{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/vaquill-ai/json-schema/vaquill-ai-draft-replace-request-schema.json",
  "title": "DraftReplaceRequest",
  "description": "Replace a draft's body, and optionally its title and lifecycle status.\n\nA PUT rather than a PATCH because `contentMarkdown` is the whole body:\na partial body is not a thing this format can express, and pretending\notherwise would invite a caller to send one paragraph and lose the rest.\nTitle and status are left alone when omitted, which is what makes a\nbody-only edit possible without restating metadata the caller did not read.\n\n`expectedVersion` is how a headless read-modify-write avoids a lost update.\nOmitting it means \"overwrite whatever is there\", which is a legitimate thing\nto want and a bad default to impose.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/vaquill-ai-drafting-api-openapi.yml#/components/schemas/DraftReplaceRequest",
  "properties": {
    "contentMarkdown": {
      "type": "string",
      "maxLength": 500000,
      "minLength": 1,
      "title": "Contentmarkdown",
      "description": "The COMPLETE new body as markdown. This replaces the whole document: a partial body is not something this format can express, so sending one paragraph loses the rest. Whitespace alone is refused."
    },
    "title": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 200,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Title",
      "description": "New title. Omit to leave the title alone."
    },
    "status": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "draft",
            "review",
            "final",
            "archived"
          ]
        },
        {
          "type": "null"
        }
      ],
      "title": "Status",
      "description": "New document lifecycle status: `draft`, `review`, `final` or `archived`. Omit to leave it alone."
    },
    "changeSummary": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Changesummary",
      "description": "Why this change was made. Recorded on the version snapshot the replace creates, so it shows up in the version list later."
    },
    "expectedVersion": {
      "anyOf": [
        {
          "type": "integer",
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Expectedversion",
      "description": "The `version` you read before editing. Supply it so a concurrent write is refused rather than silently overwritten. Omitting it means 'overwrite whatever is there'."
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "contentMarkdown"
  ]
}