{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "User profile with connections",
    "id": "http://mynet.com/schemas/user.json#",
    "properties": {
        "address": {
            "additionalProperties": {
                "type": "string"
            },
            "maxProperties": 8,
            "properties": {
                "city": {
                    "faker": "address.city",
                    "type": "string"
                },
                "country": {
                    "faker": "address.country",
                    "type": "string"
                },
                "postcode": {
                    "faker": "address.zipCode",
                    "type": "string"
                },
                "street": {
                    "faker": "address.streetAddress",
                    "type": "string"
                }
            },
            "required": [
                "street",
                "postcode",
                "city",
                "country"
            ],
            "type": "object"
        },
        "connections": {
            "items": {
                "additionalProperties": false,
                "description": "User connection schema",
                "oneOf": [
                    {
                        "properties": {
                            "connType": {
                                "enum": [
                                    "relative"
                                ]
                            },
                            "relation": {
                                "type": "string"
                            }
                        }
                    },
                    {
                        "properties": {
                            "close": {
                                "type": "boolean"
                            },
                            "connType": {
                                "enum": [
                                    "friend",
                                    "colleague",
                                    "other"
                                ]
                            },
                            "relation": {
                                "type": "boolean"
                            }
                        }
                    }
                ],
                "properties": {
                    "close": {},
                    "connType": {
                        "type": "string"
                    },
                    "id": {
                        "maximum": 99999999999,
                        "minimum": 1,
                        "type": "integer"
                    },
                    "name": {
                        "maxLength": 128,
                        "type": "string"
                    },
                    "relation": {},
                    "since": {
                        "_format": "date-time",
                        "type": "string"
                    }
                },
                "required": [
                    "id",
                    "name",
                    "since",
                    "connType"
                ],
                "title": "Connection",
                "type": "object"
            },
            "maxItems": 5,
            "type": "array"
        },
        "createdAt": {
            "_format": "date-time",
            "type": "string"
        },
        "email": {
            "_format": "email",
            "faker": "internet.email",
            "type": "string"
        },
        "feeds": {
            "additionalProperties": true,
            "description": "Feeds user subscribes to",
            "minProperties": 6,
            "title": "feeds",
            "type": "object"
        },
        "id": {
            "maximum": 99999999999,
            "minimum": 1,
            "type": "integer"
        },
        "name": {
            "faker": "name.findName",
            "maxLength": 128,
            "type": "string"
        },
        "personal": {
            "additionalProperties": false,
            "properties": {
                "DOB": {
                    "_format": "date-time",
                    "type": "string"
                },
                "age": {
                    "maximum": 130,
                    "minimum": 13,
                    "type": "integer"
                },
                "gender": {
                    "enum": [
                        "female",
                        "male"
                    ]
                }
            },
            "required": [
                "DOB",
                "age"
            ],
            "type": "object"
        },
        "phone": {
            "faker": "phone.phoneNumber",
            "pattern": "^[0-9()\\-\\.\\s]+$",
            "type": "string"
        }
    },
    "required": [
        "id",
        "name",
        "email",
        "phone",
        "address",
        "personal",
        "connections",
        "feeds",
        "createdAt"
    ],
    "title": "User",
    "type": "object"
}