{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Sparse card field value",
  "type": "object",
  "additionalProperties": true,
  "required": ["type"],
  "properties": {
    "type": {
      "enum": [
        "text",
        "rich_text",
        "image",
        "cloze",
        "tts",
        "audio",
        "image_occlusion",
        "chinese",
        "japanese",
        "code",
        "tex"
      ]
    },
    "value": {},
    "mediaPath": {
      "description": "For media fields, a direct media/<filename> path. Omission, null, and the empty string leave the field blank. Import also permits a missing media file.",
      "type": ["string", "null"]
    },
    "clozeRanges": {
      "type": ["array", "null"],
      "default": [],
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["start", "end"],
        "properties": {
          "start": { "type": "integer" },
          "end": { "type": "integer" }
        }
      }
    },
    "occlusionRects": {
      "type": ["array", "null"],
      "default": [],
      "items": {
        "type": "object",
        "additionalProperties": true,
        "required": ["x", "y", "width", "height"],
        "properties": {
          "x": { "type": "number" },
          "y": { "type": "number" },
          "width": { "type": "number" },
          "height": { "type": "number" }
        }
      }
    },
    "useTemplateSettings": { "type": ["boolean", "null"], "default": true },
    "generalSettings": {
      "anyOf": [{ "$ref": "general_settings.schema.json" }, { "type": "null" }]
    },
    "settings": {
      "anyOf": [{ "$ref": "field_settings.schema.json" }, { "type": "null" }]
    }
  }
}
