{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/myarchivist-ai/json-schema/myarchivist-ai-quest-create-schema.json",
  "title": "QuestCreate",
  "x-generated": "2026-11-18",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/myarchivist-ai-openapi.json#/components/schemas/QuestCreate",
  "properties": {
    "campaign_id": {
      "type": "string",
      "title": "Campaign Id"
    },
    "quest_name": {
      "type": "string",
      "maxLength": 255,
      "minLength": 1,
      "title": "Quest Name"
    },
    "quest_giver": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 255
        },
        {
          "type": "null"
        }
      ],
      "title": "Quest Giver"
    },
    "quest_category": {
      "$ref": "#/$defs/QuestCategoryValue",
      "default": "n/a"
    },
    "status": {
      "$ref": "#/$defs/QuestStatusValue",
      "default": "planned"
    },
    "success_definition": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ],
      "title": "Success Definition"
    },
    "failure_conditions": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ],
      "title": "Failure Conditions"
    },
    "next_action": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Action"
    },
    "resolution": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 2000
        },
        {
          "type": "null"
        }
      ],
      "title": "Resolution"
    },
    "objectives": {
      "items": {
        "$ref": "#/$defs/QuestObjectiveInput"
      },
      "type": "array",
      "title": "Objectives"
    },
    "progress_log": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Progress Log"
    },
    "related_characters": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Related Characters"
    },
    "related_factions": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Related Factions"
    },
    "related_locations": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Related Locations"
    },
    "related_items": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Related Items"
    },
    "related_entity_refs": {
      "items": {
        "$ref": "#/$defs/QuestRelatedEntityRefInput"
      },
      "type": "array",
      "title": "Related Entity Refs"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "campaign_id",
    "quest_name"
  ],
  "$defs": {
    "ObjectiveStatusValue": {
      "type": "string",
      "enum": [
        "pending",
        "in-progress",
        "completed",
        "failed",
        "blocked"
      ],
      "title": "ObjectiveStatusValue"
    },
    "QuestCategoryValue": {
      "type": "string",
      "enum": [
        "main",
        "side",
        "faction",
        "personal",
        "n/a"
      ],
      "title": "QuestCategoryValue"
    },
    "QuestEntityTypeValue": {
      "type": "string",
      "enum": [
        "character",
        "faction",
        "location",
        "item"
      ],
      "title": "QuestEntityTypeValue"
    },
    "QuestObjectiveInput": {
      "properties": {
        "text": {
          "type": "string",
          "maxLength": 1000,
          "minLength": 1,
          "title": "Text"
        },
        "status": {
          "$ref": "#/$defs/ObjectiveStatusValue",
          "default": "pending"
        }
      },
      "type": "object",
      "required": [
        "text"
      ],
      "title": "QuestObjectiveInput"
    },
    "QuestRelatedEntityRefInput": {
      "properties": {
        "entity_type": {
          "$ref": "#/$defs/QuestEntityTypeValue"
        },
        "entity_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Entity Id"
        },
        "entity_name_snapshot": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 255
            },
            {
              "type": "null"
            }
          ],
          "title": "Entity Name Snapshot"
        },
        "label": {
          "anyOf": [
            {
              "type": "string",
              "maxLength": 255
            },
            {
              "type": "null"
            }
          ],
          "title": "Label"
        }
      },
      "type": "object",
      "required": [
        "entity_type"
      ],
      "title": "QuestRelatedEntityRefInput"
    },
    "QuestStatusValue": {
      "type": "string",
      "enum": [
        "planned",
        "in-progress",
        "blocked",
        "failed",
        "done",
        "n/a"
      ],
      "title": "QuestStatusValue"
    }
  }
}