{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "properties": {
        "id": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "dataTableId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "applicationId": {
            "type": "string",
            "pattern": "^[A-Fa-f\\d]{24}$"
        },
        "creationDate": {
            "type": "string",
            "format": "date-time"
        },
        "lastUpdated": {
            "type": "string",
            "format": "date-time"
        },
        "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 255
        },
        "description": {
            "type": "string",
            "maxLength": 32767
        },
        "columns": {
            "type": "array",
            "items": {
                "title": "Data Table Column",
                "description": "Schema for a single Data Table Column",
                "type": "object",
                "properties": {
                    "name": {
                        "type": "string",
                        "pattern": "^[0-9a-zA-Z_-]{1,255}$"
                    },
                    "dataType": {
                        "type": "string",
                        "enum": [
                            "string",
                            "number",
                            "boolean"
                        ]
                    },
                    "constraint": {
                        "type": "string",
                        "enum": [
                            "unique",
                            "required",
                            "optional"
                        ]
                    },
                    "defaultValue": {
                        "type": [
                            "string",
                            "number",
                            "boolean"
                        ]
                    }
                },
                "required": [
                    "name",
                    "dataType",
                    "constraint"
                ],
                "additionalProperties": false
            },
            "maxItems": 50
        }
    }
}