{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Animation program",
    "description": "A program describing an animation run",
    "type": "object",
    "required": [
        "resources",
        "program"
    ],
    "additionalProperties": false,
    "properties": {
        "resources": {
            "description": "The resources used by this program",
            "type": "object",
            "required": [
                "images"
            ],
            "additionalProperties": false,
            "properties": {
                "images": {
                    "description": "A list of image resources to load",
                    "type": "array",
                    "items": {
                        "description": "A particular image",
                        "type": "object",
                        "required": [
                            "key",
                            "uri",
                            "targetLayer"
                        ],
                        "additionalProperties": false,
                        "properties": {
                            "key": {
                                "description": "The unique ID of this image",
                                "type": "string"
                            },
                            "uri": {
                                "description": "The location where to find this image",
                                "type": "string"
                            },
                            "targetLayer": {
                                "description": "The ID of the layer in the view port onto which to draw this image",
                                "type": "string"
                            }
                        }
                    }
                }
            }
        },
        "program": {
            "description": "The program steps",
            "type": "array",
            "items": {
                "type": "object",
                "description": "A particular step within the program",
                "required": [
                    "cmd",
                    "args"
                ],
                "additionalProperties": false,
                "properties": {
                    "cmd": {
                        "description": "The command to be executed",
                        "type": "string",
                        "enum": [
                            "moveTo",
                            "setTransparency"
                        ]
                    },
                    "args": {
                        "description": "A map of arguments for the command",
                        "type": "object"
                    }
                }
            }
        }
    }
}