{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "definitions": {
        "pets": {
            "type": "object",
            "properties": {
                "dog": {
                    "type": "string"
                },
                "cat": {
                    "type": "string"
                }
            },
            "required": [
                "dog",
                "cat"
            ]
        },
        "morePets": {
            "allOf": [
                {
                    "$ref": "#/definitions/pets"
                },
                {
                    "type": "object",
                    "properties": {
                        "horse": {
                            "type": "string"
                        }
                    }
                }
            ]
        }
    },
    "properties": {
        "pets": {
            "$ref": "#/definitions/pets"
        },
        "morePets": {
            "$ref": "#/definitions/morePets"
        }
    },
    "required": [
        "pets",
        "morePets"
    ]
}