{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "InitRequest",
  "type": "object",
  "required": [
    "fontDefs",
    "media",
    "projectId"
  ],
  "properties": {
    "fontDefs": {
      "$ref": "#/definitions/FontDefs"
    },
    "media": {
      "$ref": "#/definitions/MediaTracks"
    },
    "projectId": {
      "$ref": "#/definitions/Uuid"
    }
  },
  "additionalProperties": false,
  "definitions": {
    "Animation": {
      "type": "object",
      "required": [
        "start"
      ],
      "properties": {
        "height": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "opacity": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "rotationDegrees": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "scale": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "start": {
          "$ref": "#/definitions/Frames"
        },
        "width": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "x": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "y": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        }
      },
      "additionalProperties": false
    },
    "FontDef": {
      "type": "object",
      "required": [
        "family",
        "format",
        "properties",
        "unicodeBlock"
      ],
      "properties": {
        "family": {
          "type": "string"
        },
        "format": {
          "type": "string"
        },
        "properties": {
          "$ref": "#/definitions/FontProperties"
        },
        "unicodeBlock": {
          "$ref": "#/definitions/UnicodeBlock"
        }
      },
      "additionalProperties": false
    },
    "FontDefs": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/FontDef"
      }
    },
    "FontProperties": {
      "type": "object",
      "required": [
        "fontStyle",
        "fontWeight",
        "src",
        "unicodeRange"
      ],
      "properties": {
        "fontStyle": {
          "$ref": "#/definitions/FontStyle"
        },
        "fontWeight": {
          "type": "integer",
          "format": "uint16",
          "minimum": 0.0
        },
        "src": {
          "type": "string"
        },
        "unicodeRange": {
          "type": "string"
        }
      },
      "additionalProperties": false
    },
    "FontStyle": {
      "type": "string",
      "enum": [
        "normal",
        "italic"
      ]
    },
    "Frames": {
      "type": "integer",
      "format": "uint",
      "minimum": 0.0
    },
    "Media": {
      "type": "object",
      "required": [
        "mediaElement"
      ],
      "properties": {
        "mediaElement": {
          "$ref": "#/definitions/MediaElement"
        },
        "source": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "additionalProperties": false
    },
    "MediaElement": {
      "type": "object",
      "required": [
        "duration",
        "id",
        "mediaId",
        "position",
        "start",
        "startOnTimeline",
        "type"
      ],
      "properties": {
        "animations": {
          "default": [],
          "type": "array",
          "items": {
            "$ref": "#/definitions/Animation"
          }
        },
        "duration": {
          "description": "in seconds",
          "type": "number",
          "format": "double"
        },
        "id": {
          "type": "string"
        },
        "mediaId": {
          "$ref": "#/definitions/MediaId"
        },
        "playbackRate": {
          "default": 1.0,
          "type": "number",
          "format": "double"
        },
        "position": {
          "$ref": "#/definitions/Position"
        },
        "start": {
          "description": "in seconds",
          "type": "number",
          "format": "double"
        },
        "startOnTimeline": {
          "description": "in seconds",
          "type": "number",
          "format": "double"
        },
        "type": {
          "$ref": "#/definitions/MediaKind"
        }
      },
      "additionalProperties": false
    },
    "MediaId": {
      "type": "string"
    },
    "MediaKind": {
      "type": "string",
      "enum": [
        "audio",
        "video",
        "image",
        "text",
        "black"
      ]
    },
    "MediaTracks": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/Track"
      }
    },
    "Position": {
      "type": "object",
      "required": [
        "height",
        "scale",
        "width",
        "x",
        "y"
      ],
      "properties": {
        "height": {
          "type": "number",
          "format": "double"
        },
        "rotationDegrees": {
          "type": [
            "number",
            "null"
          ],
          "format": "double"
        },
        "scale": {
          "type": "number",
          "format": "double"
        },
        "width": {
          "type": "number",
          "format": "double"
        },
        "x": {
          "type": "number",
          "format": "double"
        },
        "y": {
          "type": "number",
          "format": "double"
        }
      },
      "additionalProperties": false
    },
    "Track": {
      "type": "array",
      "items": {
        "$ref": "#/definitions/Media"
      }
    },
    "UnicodeBlock": {
      "type": "string",
      "enum": [
        "latin",
        "latin-ext",
        "cyrillic",
        "cyrillic-ext",
        "greek",
        "greek-ext",
        "vietnamese"
      ]
    },
    "Uuid": {
      "type": "string"
    }
  }
}