{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "oneOf": [
        {
            "type": [
                "string",
                "null"
            ],
            "minLength": 2
        },
        {
            "name": "Address",
            "description": "An address object",
            "type": "object",
            "properties": {
                "street_address": {
                    "type": "string"
                },
                "locality": {
                    "type": "string"
                },
                "region": {
                    "type": "string"
                },
                "postal_code": {
                    "type": "string"
                },
                "country": {
                    "type": "string"
                },
                "country_code": {
                    "description": "ISO 3166-2 code for country",
                    "type": "string"
                }
            },
            "anyOf": [
                {
                    "required": [
                        "street_address"
                    ]
                },
                {
                    "required": [
                        "postal_code"
                    ]
                },
                {
                    "required": [
                        "locality",
                        "country"
                    ]
                }
            ]
        }
    ]
}