{
    "description": "This schema describes the format of a court as sent across the court-api",
    "properties": {
        "DX": {
            "description": "directory exchange of this court. This is used for inter-court post, and also by law professionals.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
        },
        "addresses": {
            "description": "an address for this court",
            "items": {
                "properties": {
                    "county": {
                        "maxLength": 200,
                        "minLength": 1,
                        "type": "string"
                    },
                    "lines": {
                        "description": "the street address",
                        "items": {
                            "description": "one line of this street address",
                            "maxLength": 200,
                            "minLength": 1,
                            "type": "string"
                        },
                        "maxItems": 4,
                        "minItems": 1,
                        "type": "array",
                        "_uniqueItems": true
                    },
                    "postcode": {
                        "maxLength": 20,
                        "minLength": 1,
                        "type": "string"
                    },
                    "town": {
                        "maxLength": 200,
                        "minLength": 1,
                        "type": "string"
                    },
                    "type": {
                        "description": "the type of address (postal or visiting)",
                        "maxLength": 200,
                        "minLength": 1,
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "postcode",
                    "town",
                    "lines"
                ],
                "type": "object"
            },
            "type": "array",
            "_uniqueItems": true
        },
        "alert": {
            "description": "important information about this court",
            "maxLength": 2000,
            "minLength": 1,
            "type": "string"
        },
        "areas_of_law": {
            "description": "the areas of law that this court covers",
            "items": {
                "maxLength": 200,
                "minLength": 1,
                "type": "string"
            },
            "minItems": 1,
            "type": "array",
            "_uniqueItems": true
        },
        "closed": {
            "description": "true if this court is no longer active",
            "type": "boolean"
        },
        "contacts": {
            "description": "phone contacts for this court",
            "items": {
                "properties": {
                    "name": {
                        "description": "the type of phone number (fax, enquiries, etc)",
                        "maxLength": 2000,
                        "minLength": 1,
                        "type": "string"
                    },
                    "number": {
                        "description": "the phone number of this contact",
                        "maxLength": 2000,
                        "minLength": 1,
                        "type": "string"
                    }
                },
                "required": [
                    "name",
                    "number"
                ],
                "type": "object"
            },
            "type": "array",
            "_uniqueItems": true
        },
        "court_number": {
            "description": "official number of this court. This is used on various HMCTS documents and forms.",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
        },
        "emails": {
            "description": "email addresses for this court",
            "items": {
                "properties": {
                    "address": {
                        "description": "email address",
                        "maxLength": 200,
                        "type": "string"
                    },
                    "name": {
                        "description": "what this email address is for (enquiries, etc)",
                        "maxLength": 200,
                        "minLength": 1,
                        "type": "string"
                    }
                },
                "required": [
                    "name",
                    "address"
                ],
                "type": "object"
            },
            "type": "array",
            "_uniqueItems": true
        },
        "facilities": {
            "description": "facilities available at this court",
            "items": {
                "properties": {
                    "description": {
                        "description": "detailed information for this facility",
                        "maxLength": 2000,
                        "minLength": 1,
                        "type": "string"
                    },
                    "type": {
                        "description": "the type of facility",
                        "maxLength": 200,
                        "minLength": 1,
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "description"
                ],
                "type": "object"
            },
            "type": "array",
            "_uniqueItems": true
        },
        "lat": {
            "description": "latitude of this court (WGS84)",
            "maximum": 90,
            "minimum": -90.0,
            "type": "number"
        },
        "locale": {
            "description": "language of the content of this court's description",
            "enum": [
                "en"
            ],
            "type": "string"
        },
        "lon": {
            "description": "longitude of this court (WGS84)",
            "maximum": 90,
            "minimum": -90,
            "type": "number"
        },
        "name": {
            "description": "the name of a court",
            "maxLength": 200,
            "minLength": 1,
            "type": "string"
        },
        "opening_times": {
            "description": "opening times of this court",
            "items": {
                "properties": {
                    "description": {
                        "description": "detailed information for this type of opening time",
                        "maxLength": 2000,
                        "minLength": 1,
                        "type": "string"
                    },
                    "name": {
                        "description": "the type of opening time (court building, phone lines, etc)",
                        "maxLength": 200,
                        "minLength": 1,
                        "type": "string"
                    }
                },
                "required": [
                    "name",
                    "description"
                ],
                "type": "object"
            },
            "type": "array",
            "_uniqueItems": true
        },
        "parking": {
            "description": "parking available at this court",
            "items": {
                "properties": {
                    "description": {
                        "description": "detailed information for this type of parking",
                        "maxLength": 2000,
                        "minLength": 1,
                        "type": "string"
                    },
                    "type": {
                        "description": "the type of parking",
                        "maxLength": 200,
                        "minLength": 1,
                        "type": "string"
                    }
                },
                "required": [
                    "type",
                    "description"
                ],
                "type": "object"
            },
            "type": "array",
            "_uniqueItems": true
        },
        "slug": {
            "description": "the slug used for the public uri for this court",
            "maxLength": 200,
            "minLength": 1,
            "pattern": "^[a-z\\d]+(?:-[a-z\\d]+)*$",
            "type": "string"
        },
        "update_type": {
            "description": "type of update. Only 'major' for now",
            "enum": [
                "major"
            ],
            "type": "string"
        },
        "updated_at": {
            "description": "when this court data was last updated",
            "pattern": "[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]+Z",
            "type": "string"
        }
    },
    "required": [
        "name",
        "slug",
        "updated_at",
        "update_type",
        "locale",
        "closed",
        "areas_of_law",
        "addresses"
    ],
    "title": "Court description",
    "type": "object"
}