{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Event JSON Schema to translate ORM Entity to ObjectType instance",
    "type": "object",
    "definitions": {
        "field": {
            "type": "object",
            "oneOf": [
                {
                    "properties": {
                        "type": {
                            "type": "string",
                            "enum": [
                                "callback"
                            ]
                        },
                        "value": {
                            "type": "string"
                        },
                        "options": {
                            "type": "object"
                        }
                    }
                },
                {
                    "properties": {
                        "type": {
                            "type": "string",
                            "enum": [
                                "field",
                                "value"
                            ]
                        },
                        "value": {
                            "type": [
                                "string",
                                "null",
                                "boolean",
                                "number"
                            ]
                        },
                        "options": {
                            "type": "object"
                        }
                    }
                }
            ]
        }
    },
    "properties": {
        "calendar_id": {
            "$ref": "#/definitions/field"
        },
        "source": {
            "$ref": "#/definitions/field"
        },
        "source_id": {
            "$ref": "#/definitions/field"
        },
        "event_type": {
            "$ref": "#/definitions/field"
        },
        "title": {
            "$ref": "#/definitions/field"
        },
        "content": {
            "$ref": "#/definitions/field"
        },
        "start_date": {
            "$ref": "#/definitions/field"
        },
        "end_date": {
            "$ref": "#/definitions/field"
        },
        "is_recurring": {
            "$ref": "#/definitions/field"
        },
        "recurrence": {
            "$ref": "#/definitions/field"
        },
        "is_allday": {
            "$ref": "#/definitions/field"
        }
    },
    "required": [
        "source",
        "source_id",
        "start_date"
    ]
}