{
    "$schema": "http://json-schema.org/draft-04/schema",
    "type": "object",
    "properties": {
        "ref": {
            "description": "Github branch/tag",
            "type": "string",
            "maxLength": 255
        },
        "after": {
            "type": "string",
            "title": "Github push (after commit)",
            "maxLength": 250
        },
        "deleted": {
            "type": "boolean"
        },
        "repository": {
            "$ref": "#/definitions/repository"
        }
    },
    "additionalProperties": true,
    "required": [
        "repository"
    ],
    "definitions": {
        "repository": {
            "type": "object",
            "properties": {
                "name": {
                    "description": "Name of the repository",
                    "maxLength": 100
                },
                "owner": {
                    "$ref": "#/definitions/owner"
                }
            },
            "additionalProperties": true,
            "required": [
                "name",
                "owner"
            ]
        },
        "owner": {
            "type": "object",
            "anyOf": [
                {
                    "properties": {
                        "name": {
                            "description": "Name of the repository owner",
                            "maxLength": 100
                        }
                    },
                    "required": [
                        "name"
                    ],
                    "additionalProperties": true
                },
                {
                    "properties": {
                        "login": {
                            "description": "Name of the repository owner",
                            "maxLength": 100
                        }
                    },
                    "required": [
                        "login"
                    ],
                    "additionalProperties": true
                }
            ]
        }
    }
}