{
  "id": "contentblock.json",
  "$schema": "http://json-schema.org/draft-04/schema",
  "title": "Content block",
  "description": "Any valid block of content like text, image or video",
  "definitions": {
    "type": {
      "description": "Block type",
      "example": "text",
      "type": "string",
      "enum": [
        "headline",
        "h1",
        "h2",
        "h3",
        "h4",
        "h5",
        "h6",
        "text",
        "list",
        "ul",
        "ol",
        "code",
        "image",
        "video",
        "audio",
        "article",
        "quote",
        "location",
        "cta",
        "interactive",
        "hr",
        "placeholder",
        "unknown"
      ]
    },
    "src": {
      "description": "Source URL",
      "example": "http://techcrunch.com/2015/04/15/mozilla-restructure/",
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "string",
          "format": "uri"
        }
      ]
    }
  },
  "type": [
    "object"
  ],
  "properties": {
    "id": {
      "$ref": "base.json#/definitions/uuid"
    },
    "item": {
      "$ref": "base.json#/definitions/uuid"
    },
    "type": {
      "$ref": "#/definitions/type"
    },
    "src": {
      "$ref": "#/definitions/src"
    },
    "metadata": {
      "$ref": "metadata.json"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    },
    "updated_at": {
      "oneOf": [
        {
          "type": "null"
        },
        {
          "type": "string",
          "format": "date-time"
        }
      ]
    }
  },
  "allOf": [
    {
      "required": [
        "type"
      ]
    },
    {
      "oneOf": [
        {
          "$ref": "audio.json"
        },
        {
          "$ref": "article.json"
        },
        {
          "$ref": "code.json"
        },
        {
          "$ref": "cta.json"
        },
        {
          "$ref": "headline.json"
        },
        {
          "$ref": "hr.json"
        },
        {
          "$ref": "image.json"
        },
        {
          "$ref": "list.json"
        },
        {
          "$ref": "location.json"
        },
        {
          "$ref": "quote.json"
        },
        {
          "$ref": "placeholder.json"
        },
        {
          "$ref": "text.json"
        },
        {
          "$ref": "video.json"
        }
      ]
    }
  ]
}