{
  "definitions": {
    "inlineStyleDef": {
      "definitions": {},
      "$schema": "http://json-schema.org/draft-07/schema#",
      "$id": "https://wix-rich-content/inline-style.json",
      "type": "object",
      "title": "inline style",
      "required": ["offset", "length", "style"],
      "properties": {
        "offset": {
          "$id": "#/properties/offset",
          "type": "integer",
          "title": "offset",
          "default": 0,
          "min": 0,
          "examples": [0]
        },
        "length": {
          "$id": "#/properties/length",
          "type": "integer",
          "title": "length",
          "default": 0,
          "min": 0,
          "examples": [4]
        },
        "style": {
          "$id": "#/properties/style",
          "type": "string",
          "title": "style",
          "default": "",
          "examples": ["color4"],
          "pattern": "^(.*)$"
        }
      }
    },
    "entityRangeDef": {
      "definitions": {},
      "$schema": "http://json-schema.org/draft-07/schema#",
      "$id": "https://wix-rich-content/entity-range.json",
      "type": "object",
      "title": "inline style",
      "required": ["offset", "length", "key"],
      "properties": {
        "offset": {
          "$id": "#/properties/offset",
          "type": "integer",
          "title": "offset",
          "default": 0,
          "min": 0,
          "examples": [0]
        },
        "length": {
          "$id": "#/properties/length",
          "type": "integer",
          "title": "length",
          "default": 0,
          "min": 0,
          "examples": [4]
        },
        "key": {
          "$id": "#/properties/style",
          "type": "integer",
          "title": "key",
          "default": "",
          "examples": [0]
        }
      }
    },
    "entityDef": {
      "definitions": {},
      "$schema": "http://json-schema.org/draft-07/schema#",
      "$id": "https://wix-rich-content/entity-range.json",
      "type": "object",
      "title": "entity",
      "required": ["type", "mutability", "data"],
      "properties": {
        "type": {
          "$id": "#/properties/type",
          "enum": [
            "IMAGE",
            "VIDEO-EMBED",
            "LINK",
            "mention",
            "wix-draft-plugin-image",
            "wix-draft-plugin-button",
            "wix-draft-plugin-video",
            "wix-draft-plugin-gallery",
            "wix-draft-plugin-link",
            "wix-draft-plugin-html",
            "wix-draft-plugin-sound-cloud",
            "wix-draft-plugin-hashtag",
            "wix-draft-plugin-divider",
            "wix-draft-plugin-emoji",
            "wix-draft-plugin-giphy",
            "wix-draft-plugin-map",
            "wix-draft-plugin-file-upload",
            "LINK_PREVIEW"
          ],
          "title": "entity type",
          "examples": ["wix-draft-plugin-image"]
        },
        "mutability": {
          "$id": "#/properties/mutability",
          "type": "string",
          "enum": ["MUTABLE", "IMMUTABLE", "SEGMENTED"],
          "title": "entity mutability",
          "examples": ["IMMUTABLE"]
        },
        "data": {
          "$id": "#/properties/data",
          "type": "object",
          "title": "entity data"
        }
      }
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://wix-rich-content/content-state-schema.json",
  "type": "object",
  "title": "content state",
  "required": ["blocks", "entityMap", "VERSION"],
  "properties": {
    "blocks": {
      "$id": "#/properties/blocks",
      "type": "array",
      "title": "blocks",
      "items": {
        "$id": "#/properties/blocks/items",
        "type": "object",
        "title": "block",
        "required": ["key", "text", "type", "inlineStyleRanges", "entityRanges", "data"],
        "properties": {
          "key": {
            "$id": "#/properties/blocks/items/properties/key",
            "type": "string",
            "title": "block key",
            "default": "",
            "examples": ["45qkg"],
            "pattern": "^(.*)$"
          },
          "text": {
            "$id": "#/properties/blocks/items/properties/text",
            "type": "string",
            "title": "text",
            "default": "",
            "examples": ["test"],
            "pattern": "^(.|\n)*$"
          },
          "type": {
            "$id": "#/properties/blocks/items/properties/type",
            "type": "string",
            "title": "block type",
            "default": "",
            "examples": ["unstyled"],
            "enum": [
              "unstyled",
              "header-one",
              "header-two",
              "header-three",
              "header-four",
              "header-five",
              "header-six",
              "unordered-list-item",
              "ordered-list-item",
              "blockquote",
              "atomic",
              "code-block"
            ]
          },
          "depth": {
            "$id": "#/properties/blocks/items/properties/depth",
            "type": "integer",
            "title": "depth",
            "default": 0,
            "examples": [0]
          },
          "inlineStyleRanges": {
            "$id": "#/properties/blocks/items/properties/inlineStyleRanges",
            "type": "array",
            "title": "inline style ranges",
            "items": {
              "$ref": "#/definitions/inlineStyleDef"
            }
          },
          "entityRanges": {
            "$id": "#/properties/blocks/items/properties/entityRanges",
            "type": "array",
            "title": "entity ranges",
            "default": null,
            "items": { "$ref": "#/definitions/entityRangeDef" }
          },
          "data": {
            "$id": "#/properties/blocks/items/properties/data",
            "type": "object",
            "title": "data",
            "default": null
          }
        }
      }
    },
    "entityMap": {
      "$id": "#/properties/entityMap",
      "type": "object",
      "title": "entity map",
      "patternProperties": {
        "[0-9]+": {
          "$ref": "#/definitions/entityDef"
        }
      }
    }
  }
}
