{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "required": [
        "person",
        "password",
        "password_again",
        "orientation"
    ],
    "type": "object",
    "definitions": {
        "person": {
            "type": "object",
            "required": [
                "first_name",
                "last_name",
                "address"
            ],
            "properties": {
                "first_name": {
                    "type": "string",
                    "minLength": 2
                },
                "last_name": {
                    "type": "string",
                    "minLength": 2
                },
                "address": {
                    "$ref": "#/definitions/address"
                }
            }
        },
        "address": {
            "type": "object",
            "required": [
                "street",
                "street_number",
                "city",
                "country"
            ],
            "properties": {
                "street": {
                    "type": "string"
                },
                "street_number": {
                    "type": "string",
                    "pattern": "^[0-9]+$"
                },
                "city": {
                    "type": "string"
                },
                "country": {
                    "type": "string"
                }
            }
        }
    },
    "properties": {
        "person": {
            "$ref": "#/definitions/person"
        },
        "password": {
            "type": "string"
        },
        "orientation": {
            "type": "string",
            "default": "horizontal",
            "enum": [
                "vertical"
            ]
        }
    }
}