{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "definitions": { "city": { "type": "string", "enum": [ "Tel Aviv", "New York", "London" ] } }, "properties": { "address": { "type": "object", "properties": { "streetAddress": { "type": "string" }, "city": { "$ref": "#/definitions/city" } }, "enum": [ { "streetAddress": "21 2nd Street", "city": "New York" } ], "required": [ "streetAddress", "city" ] }, "phoneNumber": { "type": "array", "items": { "type": "object", "properties": { "location": { "type": "string" }, "code": { "type": "integer" } }, "required": [ "location", "code" ] } }, "dateOfBirth" : { "type" : "string", "pattern" : "(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/((19|20)\\d\\d)" }, "gender" : { "type" : "string" }, "cityOfBirth" : { "$ref" : "#/definitions/city"} }, "required": [ "address", "phoneNumber" ] }