{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "definitions": {
        "ownerType": {
            "type": "string",
            "enum": [
                "user",
                "organization"
            ]
        },
        "blocks": {
            "type": "array",
            "items": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string"
                    },
                    "blockType": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string",
                        "maxLength": 255
                    },
                    "applicationId": {
                        "type": "string",
                        "pattern": "^[A-Fa-f\\d]{24}$"
                    },
                    "startX": {
                        "type": "integer"
                    },
                    "startY": {
                        "type": "integer"
                    },
                    "width": {
                        "type": "integer"
                    },
                    "height": {
                        "type": "integer"
                    },
                    "config": {
                        "type": "object"
                    }
                },
                "required": [
                    "id",
                    "blockType",
                    "startX",
                    "startY",
                    "width",
                    "height"
                ]
            }
        }
    },
    "properties": {
        "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "dashboardId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "creationDate": {
            "type": "string",
            "format": "date-time"
        },
        "lastUpdated": {
            "type": "string",
            "format": "date-time"
        },
        "ownerId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "ownerType": {
            "$ref": "#/definitions/ownerType"
        },
        "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
        },
        "blocks": {
            "$ref": "#/definitions/blocks"
        }
    }
}