export default {
  "type": "object",
  "properties": {
    "nodes": {
      "type": "array",
      "items": {
        "anyOf": [
          {
            "$ref": "#/definitions/ParagraphNode"
          },
          {
            "$ref": "#/definitions/HeadingNode"
          },
          {
            "$ref": "#/definitions/BulletedListNode"
          }
        ]
      }
    }
  },
  "required": [
    "nodes"
  ],
  "additionalProperties": false,
  "definitions": {
    "Link": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string"
        },
        "anchor": {
          "type": "string"
        },
        "target": {
          "type": "string",
          "enum": [
            "SELF",
            "BLANK",
            "PARENT",
            "TOP"
          ]
        }
      },
      "required": [
        "url",
        "anchor",
        "target"
      ],
      "additionalProperties": false
    },
    "BoldDecoration": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "BOLD"
          ]
        },
        "fontWeightValue": {
          "type": "number"
        }
      },
      "required": [
        "type",
        "fontWeightValue"
      ],
      "additionalProperties": false
    },
    "ItalicDecoration": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "ITALIC"
          ]
        },
        "italicData": {
          "type": "boolean"
        }
      },
      "required": [
        "type",
        "italicData"
      ],
      "additionalProperties": false
    },
    "UnderlineDecoration": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "UNDERLINE"
          ]
        },
        "underlineData": {
          "type": "boolean"
        }
      },
      "required": [
        "type",
        "underlineData"
      ],
      "additionalProperties": false
    },
    "LinkDecoration": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "LINK"
          ]
        },
        "linkData": {
          "$ref": "#/definitions/LinkData"
        }
      },
      "required": [
        "type",
        "linkData"
      ],
      "additionalProperties": false
    },
    "LinkData": {
      "type": "object",
      "properties": {
        "link": {
          "$ref": "#/definitions/Link"
        }
      },
      "required": [
        "link"
      ],
      "additionalProperties": false
    },
    "HeadingNode": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "HEADING"
          ]
        },
        "nodes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TextNode"
          }
        },
        "id": {
          "type": "string"
        },
        "headingData": {
          "$ref": "#/definitions/HeadingData"
        }
      },
      "required": [
        "type",
        "nodes",
        "id",
        "headingData"
      ],
      "additionalProperties": false
    },
    "HeadingData": {
      "type": "object",
      "properties": {
        "level": {
          "type": "integer"
        },
        "indentation": {
          "type": "integer"
        }
      },
      "required": [
        "level",
        "indentation"
      ],
      "additionalProperties": false
    },
    "BulletedListNode": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "BULLETED_LIST"
          ]
        },
        "nodes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/ListItemNode"
          }
        },
        "id": {
          "type": "string"
        },
        "bulletedListData": {
          "$ref": "#/definitions/BulletedListData"
        }
      },
      "required": [
        "type",
        "nodes",
        "id",
        "bulletedListData"
      ],
      "additionalProperties": false
    },
    "BulletedListData": {
      "type": "object",
      "properties": {
        "indentation": {
          "type": "integer"
        },
        "offset": {
          "type": "integer"
        }
      },
      "required": [
        "indentation",
        "offset"
      ],
      "additionalProperties": false
    },
    "ListItemNode": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "LIST_ITEM"
          ]
        },
        "nodes": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "$ref": "#/definitions/ParagraphNode"
              },
              {
                "$ref": "#/definitions/HeadingNode"
              },
              {
                "$ref": "#/definitions/BulletedListNode"
              }
            ]
          }
        },
        "id": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "nodes",
        "id"
      ],
      "additionalProperties": false
    },
    "ParagraphNode": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "PARAGRAPH"
          ]
        },
        "nodes": {
          "type": "array",
          "items": {
            "$ref": "#/definitions/TextNode"
          }
        },
        "id": {
          "type": "string"
        },
        "paragraphData": {
          "$ref": "#/definitions/ParagraphData"
        }
      },
      "required": [
        "type",
        "nodes",
        "id",
        "paragraphData"
      ],
      "additionalProperties": false
    },
    "ParagraphData": {
      "type": "object",
      "properties": {
        "indentation": {
          "type": "integer"
        }
      },
      "required": [
        "indentation"
      ],
      "additionalProperties": false
    },
    "TextNode": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "TEXT"
          ]
        },
        "textData": {
          "$ref": "#/definitions/TextData"
        },
        "id": {
          "type": "string"
        }
      },
      "required": [
        "type",
        "textData",
        "id"
      ],
      "additionalProperties": false
    },
    "TextData": {
      "type": "object",
      "properties": {
        "text": {
          "type": "string"
        },
        "decorations": {
          "type": "array",
          "items": {
            "anyOf": [
              {
                "$ref": "#/definitions/BoldDecoration"
              },
              {
                "$ref": "#/definitions/ItalicDecoration"
              },
              {
                "$ref": "#/definitions/UnderlineDecoration"
              },
              {
                "$ref": "#/definitions/LinkDecoration"
              }
            ]
          }
        }
      },
      "required": [
        "text",
        "decorations"
      ],
      "additionalProperties": false
    }
  }
}