{
    "$schema": "http://json-schema.org/draft-04/schema",
    "title": "Tree container",
    "description": "Testing chained containers",
    "$ref": "#/definitions/LevelOneContainer",
    "definitions": {
        "Item": {
            "properties": {
                "name": {
                    "type": "string"
                },
                "value": {
                    "type": "integer"
                }
            }
        },
        "LevelThreeContainer": {
            "properties": {
                "items": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/Item"
                    }
                }
            }
        },
        "LevelTwoContainer": {
            "oneOf": [
                {
                    "properties": {
                        "threes": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/LevelThreeContainer"
                            }
                        }
                    }
                },
                {
                    "#ref": "#/definitions/LevelThreeContainer"
                }
            ]
        },
        "LevelOneContainer": {
            "oneOf": [
                {
                    "properties": {
                        "twos": {
                            "type": "array",
                            "items": {
                                "$ref": "#/definitions/LevelTwoContainer"
                            }
                        }
                    }
                },
                {
                    "#ref": "#/definitions/LevelTwoContainer"
                }
            ]
        }
    }
}