| 1 |
{ |
| 2 |
"type": "object", |
| 3 |
"properties": { |
| 4 |
"version": { |
| 5 |
"$ref": "#/definitions/decimal_type" |
| 6 |
}, |
| 7 |
"address": { |
| 8 |
"$ref": "#/definitions/address_type" |
| 9 |
}, |
| 10 |
"phones": { |
| 11 |
"type": "array", |
| 12 |
"minItems": 1, |
| 13 |
"maxItems": 2, |
| 14 |
"uniqueItems": true, |
| 15 |
"items": { |
| 16 |
"$ref": "#/definitions/phone_type" |
| 17 |
} |
| 18 |
}, |
| 19 |
"names": { |
| 20 |
"type": "array", |
| 21 |
"items": [ |
| 22 |
{ "type": "string" }, |
| 23 |
{ "type": "string" } |
| 24 |
], |
| 25 |
"additionalItems": false |
| 26 |
}, |
| 27 |
"extra": { |
| 28 |
"type": "object", |
| 29 |
"patternProperties": { |
| 30 |
"^S_": { "type": "string" } |
| 31 |
} |
| 32 |
}, |
| 33 |
"gender": { |
| 34 |
"type": "string", |
| 35 |
"enum": ["M", "F"] |
| 36 |
} |
| 37 |
}, |
| 38 |
"additionalProperties": false, |
| 39 |
"dependencies": { |
| 40 |
"address": [ "version" ], |
| 41 |
"names": { |
| 42 |
"properties": { |
| 43 |
"version": { "$ref": "#/definitions/decimal_type" } |
| 44 |
}, |
| 45 |
"required": ["version"] |
| 46 |
} |
| 47 |
}, |
| 48 |
"definitions": { |
| 49 |
"address_type": { |
| 50 |
"type": "object", |
| 51 |
"properties": { |
| 52 |
"number": { |
| 53 |
"$ref": "#/definitions/positiveInt_type" |
| 54 |
}, |
| 55 |
"street1": { |
| 56 |
"type": "string" |
| 57 |
}, |
| 58 |
"street2": { |
| 59 |
"type": ["string", "null"] |
| 60 |
}, |
| 61 |
"street3": { |
| 62 |
"not": { "type": ["boolean", "number", ",integer", "object", "null"] } |
| 63 |
}, |
| 64 |
"city": { |
| 65 |
"type": "string", |
| 66 |
"maxLength": 10, |
| 67 |
"minLength": 4 |
| 68 |
}, |
| 69 |
"area": { |
| 70 |
"oneOf": [ |
| 71 |
{ "$ref": "#/definitions/county_type" }, |
| 72 |
{ "$ref": "#/definitions/province_type" } |
| 73 |
] |
| 74 |
}, |
| 75 |
"country": { |
| 76 |
"allOf": [ |
| 77 |
{ "$ref": "#/definitions/country_type" } |
| 78 |
] |
| 79 |
}, |
| 80 |
"postcode": { |
| 81 |
"anyOf": [ |
| 82 |
{ "type": "string", "pattern": "^[A-Z]{2}[0-9]{1,2} [0-9][A-Z]{2}$" }, |
| 83 |
{ "type": "string", "pattern": "^[0-9]{5}$" } |
| 84 |
] |
| 85 |
} |
| 86 |
}, |
| 87 |
"minProperties": 7, |
| 88 |
"required": [ |
| 89 |
"number", |
| 90 |
"street1", |
| 91 |
"city" |
| 92 |
] |
| 93 |
}, |
| 94 |
"country_type": { |
| 95 |
"type": "string", |
| 96 |
"enum": ["UK", "Canada"] |
| 97 |
}, |
| 98 |
"county_type": { |
| 99 |
"type": "string", |
| 100 |
"enum": ["Sussex", "Surrey", "Kent", "Narnia"] |
| 101 |
}, |
| 102 |
"province_type": { |
| 103 |
"type": "string", |
| 104 |
"enum": ["Quebec", "Narnia", "BC", "Alberta"] |
| 105 |
}, |
| 106 |
"date_type": { |
| 107 |
"pattern": "^([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1]))?)?$", |
| 108 |
"type": "string" |
| 109 |
}, |
| 110 |
"positiveInt_type": { |
| 111 |
"minimum": 0, |
| 112 |
"exclusiveMinimum": true, |
| 113 |
"maximum": 100, |
| 114 |
"exclusiveMaximum": true, |
| 115 |
"type": "integer" |
| 116 |
}, |
| 117 |
"decimal_type": { |
| 118 |
"multipleOf": 1.0, |
| 119 |
"type": "number" |
| 120 |
}, |
| 121 |
"time_type": { |
| 122 |
"pattern": "^([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?$", |
| 123 |
"type": "string" |
| 124 |
}, |
| 125 |
"unsignedInt_type": { |
| 126 |
"type": "integer", |
| 127 |
"minimum": 0, |
| 128 |
"maximum": 99999 |
| 129 |
}, |
| 130 |
"phone_type": { |
| 131 |
"pattern": "^[0-9]*-[0-9]*", |
| 132 |
"type": "string" |
| 133 |
}, |
| 134 |
"url_type": { |
| 135 |
"type": "string" |
| 136 |
} |
| 137 |
} |
| 138 |
} |