{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "additionalProperties": false,
    "definitions": {
        "absolute_fullpath": {
            "description": "A path with optional query string and/or fragment.",
            "pattern": "^/(([a-zA-Z0-9._~!$&'()*+,;=:@-]|%[0-9a-fA-F]{2})+(/([a-zA-Z0-9._~!$&'()*+,;=:@-]|%[0-9a-fA-F]{2})*)*)?(\\?([a-zA-Z0-9._~!$&'()*+,;=:@-]|%[0-9a-fA-F]{2})*)?(#([a-zA-Z0-9._~!$&'()*+,;=:@-]|%[0-9a-fA-F]{2})*)?$",
            "type": "string"
        },
        "absolute_path": {
            "description": "A path only. Query string and/or fragment are not allowed.",
            "pattern": "^/(([a-zA-Z0-9._~!$&'()*+,;=:@-]|%[0-9a-fA-F]{2})+(/([a-zA-Z0-9._~!$&'()*+,;=:@-]|%[0-9a-fA-F]{2})*)*)?$",
            "type": "string"
        },
        "analytics_identifier": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ],
            "description": "A short identifier we send to Google Analytics for multi-valued fields. This means we avoid the truncated values we would get if we sent the path or slug of eg organisations."
        },
        "application_name": {
            "description": "Applications on GOV.UK only use lowercase letters and dashes",
            "pattern": "[a-z-]",
            "type": "string"
        },
        "asset_link": {
            "additionalProperties": false,
            "properties": {
                "content_id": {
                    "$ref": "#/definitions/guid"
                },
                "content_type": {
                    "type": "string"
                },
                "created_at": {
                    "format": "date-time"
                },
                "title": {
                    "type": "string"
                },
                "updated_at": {
                    "format": "date-time"
                },
                "url": {
                    "_format": "uri",
                    "type": "string"
                }
            },
            "required": [
                "url",
                "content_type"
            ],
            "type": "object"
        },
        "change_history": {
            "items": {
                "additionalProperties": false,
                "properties": {
                    "note": {
                        "description": "A summary of the change",
                        "type": "string"
                    },
                    "public_timestamp": {
                        "_format": "date-time",
                        "type": "string"
                    },
                    "reason_for_change": {
                        "description": "Why the change is being made. This is multiline text, and will be rendered inside <p> tags. Govspeak is not yet supported here.",
                        "type": "string"
                    }
                },
                "required": [
                    "public_timestamp",
                    "note"
                ],
                "type": "object"
            },
            "type": "array"
        },
        "details": {
            "additionalProperties": false,
            "properties": {
                "archive_notice": {
                    "additionalProperties": false,
                    "properties": {
                        "archived_at": {
                            "format": "date-time"
                        },
                        "explanation": {
                            "type": "string"
                        }
                    },
                    "type": "object"
                },
                "body": {
                    "type": "string"
                },
                "change_history": {
                    "$ref": "#/definitions/change_history"
                },
                "change_note": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "emphasised_organisations": {
                    "$ref": "#/definitions/emphasised_organisations"
                },
                "first_public_at": {
                    "_format": "date-time",
                    "type": "string"
                },
                "format_display_type": {
                    "enum": [
                        "case_study"
                    ],
                    "type": "string"
                },
                "image": {
                    "$ref": "#/definitions/image"
                },
                "tags": {
                    "additionalProperties": false,
                    "properties": {
                        "browse_pages": {
                            "items": {
                                "type": "string"
                            },
                            "type": "array"
                        },
                        "policies": {
                            "items": {
                                "type": "string"
                            },
                            "type": "array"
                        },
                        "topics": {
                            "items": {
                                "type": "string"
                            },
                            "type": "array"
                        }
                    },
                    "type": "object"
                },
                "withdrawn_notice": {
                    "$ref": "#/definitions/withdrawn_notice"
                }
            },
            "required": [
                "body",
                "first_public_at"
            ],
            "type": "object"
        },
        "emphasised_organisations": {
            "description": "The content ids of the organisations that should be displayed first in the list of organisations related to the item, these content ids must be present in the item organisation links hash.",
            "items": {
                "$ref": "#/definitions/guid"
            },
            "type": "array"
        },
        "frontend_links": {
            "items": {
                "additionalProperties": false,
                "properties": {
                    "analytics_identifier": {
                        "$ref": "#/definitions/analytics_identifier"
                    },
                    "api_path": {
                        "$ref": "#/definitions/absolute_path"
                    },
                    "api_url": {
                        "_format": "uri",
                        "description": "DEPRECATED: api_path should be used instead of api_url. This is due to values of api_url being tied to an environment which can cause problems when data is synced between environments. In time this field will be removed by the Publishing Platform team.",
                        "type": "string"
                    },
                    "base_path": {
                        "$ref": "#/definitions/absolute_path"
                    },
                    "content_id": {
                        "$ref": "#/definitions/guid"
                    },
                    "description": {
                        "anyOf": [
                            {
                                "type": "string"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "details": {
                        "additionalProperties": true,
                        "type": "object"
                    },
                    "document_type": {
                        "type": "string"
                    },
                    "links": {
                        "patternProperties": {
                            "^[a-z_]+$": {
                                "$ref": "#/definitions/frontend_links"
                            }
                        },
                        "type": "object"
                    },
                    "locale": {
                        "$ref": "#/definitions/locale"
                    },
                    "public_updated_at": {
                        "type": "string"
                    },
                    "schema_name": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "web_url": {
                        "_format": "uri",
                        "description": "DEPRECATED: base_path should be used instead of web_url. This is due to values of web_url being tied to an environment which can cause problems when data is synced between environments. In time this field will be removed by the Publishing Platform team.",
                        "type": "string"
                    }
                },
                "required": [
                    "content_id",
                    "title",
                    "base_path",
                    "locale"
                ],
                "type": "object"
            },
            "type": "array"
        },
        "government": {
            "additionalProperties": false,
            "properties": {
                "current": {
                    "description": "Is the government that published this document still the current government.",
                    "type": "boolean"
                },
                "slug": {
                    "description": "Government slug, used for analytics, eg '1970-to-1974-conservative-government'.",
                    "type": "string"
                },
                "title": {
                    "description": "Name of the government that first published this document, eg '1970 to 1974 Conservative government'.",
                    "type": "string"
                }
            },
            "required": [
                "title",
                "slug",
                "current"
            ],
            "type": "object"
        },
        "guid": {
            "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$",
            "type": "string"
        },
        "guid_list": {
            "items": {
                "$ref": "#/definitions/guid"
            },
            "type": "array",
            "_uniqueItems": true
        },
        "image": {
            "additionalProperties": false,
            "properties": {
                "alt_text": {
                    "type": "string"
                },
                "caption": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "url": {
                    "_format": "uri",
                    "type": "string"
                }
            },
            "required": [
                "url"
            ],
            "type": "object"
        },
        "label_value_pair": {
            "additionalProperties": false,
            "description": "One of many possible values a user can select from",
            "properties": {
                "label": {
                    "description": "A human readable label",
                    "type": "string"
                },
                "value": {
                    "description": "A value to use for form controls",
                    "type": "string"
                }
            },
            "required": [
                "label",
                "value"
            ],
            "type": "object"
        },
        "locale": {
            "enum": [
                "ar",
                "az",
                "be",
                "bg",
                "bn",
                "cs",
                "cy",
                "de",
                "dr",
                "el",
                "en",
                "es",
                "es-419",
                "et",
                "fa",
                "fr",
                "he",
                "hi",
                "hu",
                "hy",
                "id",
                "it",
                "ja",
                "ka",
                "ko",
                "lt",
                "lv",
                "ms",
                "pl",
                "ps",
                "pt",
                "ro",
                "ru",
                "si",
                "sk",
                "so",
                "sq",
                "sr",
                "sw",
                "ta",
                "th",
                "tk",
                "tr",
                "uk",
                "ur",
                "uz",
                "vi",
                "zh",
                "zh-hk",
                "zh-tw"
            ],
            "type": "string"
        },
        "multiple_content_types": {
            "items": {
                "additionalProperties": false,
                "properties": {
                    "content": {
                        "type": "string"
                    },
                    "content_type": {
                        "type": "string"
                    }
                },
                "required": [
                    "content_type",
                    "content"
                ],
                "type": "object"
            },
            "type": "array"
        },
        "nation_applicability": {
            "additionalProperties": false,
            "description": "An object specifying the applicability of a particular nation.",
            "properties": {
                "alternative_url": {
                    "description": "An optional alternative URL to link to for more information on this content item pertaining to this nation.",
                    "type": "string"
                },
                "applicable": {
                    "description": "Whether the content applies to this nation or not.",
                    "type": "boolean"
                },
                "label": {
                    "description": "The pretty-printed, translated label for this nation.",
                    "type": "string"
                }
            },
            "type": "object"
        },
        "national_applicability": {
            "additionalProperties": false,
            "description": "An object specifying the applicable nations for this content item. If it applies to all nations, it should be omitted.",
            "properties": {
                "england": {
                    "$ref": "#/definitions/nation_applicability"
                },
                "northern_ireland": {
                    "$ref": "#/definitions/nation_applicability"
                },
                "scotland": {
                    "$ref": "#/definitions/nation_applicability"
                },
                "wales": {
                    "$ref": "#/definitions/nation_applicability"
                }
            },
            "type": "object"
        },
        "political": {
            "description": "If the content is considered political in nature, reflecting views of the government it was published under.",
            "type": "boolean"
        },
        "redirect_route": {
            "additionalProperties": false,
            "properties": {
                "destination": {
                    "$ref": "#/definitions/absolute_fullpath"
                },
                "path": {
                    "$ref": "#/definitions/absolute_path"
                },
                "segments_mode": {
                    "description": "For prefix redirects, preserve or ignore the rest of the fullpath. For exact, preserve or ignore the querystring.",
                    "enum": [
                        "preserve",
                        "ignore"
                    ]
                },
                "type": {
                    "enum": [
                        "prefix",
                        "exact"
                    ]
                }
            },
            "required": [
                "path",
                "type",
                "destination"
            ],
            "type": "object"
        },
        "route": {
            "additionalProperties": false,
            "properties": {
                "path": {
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "prefix",
                        "exact"
                    ]
                }
            },
            "required": [
                "path",
                "type"
            ],
            "type": "object"
        },
        "withdrawn_notice": {
            "additionalProperties": false,
            "properties": {
                "explanation": {
                    "type": "string"
                },
                "withdrawn_at": {
                    "format": "date-time"
                }
            },
            "type": "object"
        }
    },
    "properties": {
        "analytics_identifier": {
            "$ref": "#/definitions/analytics_identifier"
        },
        "base_path": {
            "$ref": "#/definitions/absolute_path"
        },
        "content_id": {
            "$ref": "#/definitions/guid"
        },
        "description": {
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ]
        },
        "details": {
            "$ref": "#/definitions/details"
        },
        "document_type": {
            "type": "string"
        },
        "first_published_at": {
            "_format": "date-time",
            "type": "string"
        },
        "format": {
            "type": "string"
        },
        "last_edited_at": {
            "_format": "date-time",
            "description": "Last time when the content received a major or minor update.",
            "type": "string"
        },
        "links": {
            "additionalProperties": false,
            "properties": {
                "available_translations": {
                    "$ref": "#/definitions/frontend_links"
                },
                "child_taxons": {
                    "$ref": "#/definitions/frontend_links"
                },
                "children": {
                    "$ref": "#/definitions/frontend_links"
                },
                "document_collections": {
                    "$ref": "#/definitions/frontend_links"
                },
                "mainstream_browse_pages": {
                    "$ref": "#/definitions/frontend_links"
                },
                "ordered_related_items": {
                    "$ref": "#/definitions/frontend_links"
                },
                "organisations": {
                    "$ref": "#/definitions/frontend_links"
                },
                "parent": {
                    "$ref": "#/definitions/frontend_links"
                },
                "policies": {
                    "$ref": "#/definitions/frontend_links"
                },
                "policy_areas": {
                    "$ref": "#/definitions/frontend_links"
                },
                "related_policies": {
                    "$ref": "#/definitions/frontend_links"
                },
                "taxons": {
                    "$ref": "#/definitions/frontend_links"
                },
                "topics": {
                    "$ref": "#/definitions/frontend_links"
                },
                "world_locations": {
                    "$ref": "#/definitions/frontend_links"
                },
                "worldwide_organisations": {
                    "$ref": "#/definitions/frontend_links"
                }
            },
            "type": "object"
        },
        "locale": {
            "$ref": "#/definitions/locale"
        },
        "need_ids": {
            "items": {
                "type": "string"
            },
            "type": "array"
        },
        "phase": {
            "description": "The service design phase of this content item - https://www.gov.uk/service-manual/phases",
            "enum": [
                "alpha",
                "beta",
                "live"
            ],
            "type": "string"
        },
        "public_updated_at": {
            "_format": "date-time",
            "type": "string"
        },
        "publishing_app": {
            "$ref": "#/definitions/application_name"
        },
        "rendering_app": {
            "$ref": "#/definitions/application_name"
        },
        "schema_name": {
            "enum": [
                "case_study"
            ],
            "type": "string"
        },
        "title": {
            "type": "string"
        },
        "updated_at": {
            "_format": "date-time",
            "type": "string"
        },
        "withdrawn_notice": {
            "$ref": "#/definitions/withdrawn_notice"
        }
    },
    "required": [
        "base_path",
        "links",
        "title",
        "details",
        "locale",
        "content_id",
        "document_type",
        "schema_name"
    ],
    "type": "object"
}