1{ 2 "$schema": "http://json-schema.org/draft-07/schema#", 3 "type": "object", 4 "properties": { 5 "cars": { 6 "type": "array", 7 "items": { 8 "$ref": "#car" 9 } 10 } 11 }, 12 "definitions": { 13 "car": { 14 "$id": "#car", 15 "type": "object", 16 "properties": { 17 "model": { 18 "type": "string" 19 }, 20 "manufacturer": { 21 "$ref": "#manufacturer" 22 } 23 }, 24 "required": [ 25 "model", 26 "manufacturer" 27 ] 28 }, 29 "manufacturer": { 30 "$id": "#manufacturer", 31 "type": "object", 32 "properties": { 33 "name": { 34 "type": "string" 35 }, 36 "factories": { 37 "type": "array", 38 "items": { 39 "$ref": "#factory" 40 } 41 } 42 } 43 }, 44 "factory": { 45 "$id": "#factory", 46 "type": "object", 47 "properties": { 48 "location": { 49 "$ref": "#location" 50 } 51 } 52 }, 53 "location": { 54 "$id": "#location", 55 "type": "object", 56 "properties": { 57 "country": { 58 "type": "string" 59 }, 60 "city": { 61 "type": "string" 62 }, 63 "employees": { 64 "type": "array", 65 "items": { 66 "$ref": "#employee" 67 } 68 } 69 }, 70 "additionalProperties": false 71 }, 72 "employee": { 73 "$id": "#employee", 74 "type": "object", 75 "properties": { 76 "name": { 77 "type": "string" 78 }, 79 "surname": { 80 "type": "string" 81 } 82 }, 83 "additionalProperties": true, 84 "maxProperties": 3 85 } 86 } 87} 88