{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "type": "object",
    "required": [
        "base_path",
        "content_id",
        "document_type",
        "govuk_request_id",
        "locale",
        "payload_version",
        "schema_name"
    ],
    "additionalProperties": false,
    "properties": {
        "analytics_identifier": {
            "$ref": "#/definitions/analytics_identifier"
        },
        "base_path": {
            "$ref": "#/definitions/absolute_path"
        },
        "content_id": {
            "$ref": "#/definitions/guid"
        },
        "content_purpose_document_supertype": {
            "description": "DEPRECATED. Use `content_purpose_subgroup`.",
            "type": "string"
        },
        "content_purpose_subgroup": {
            "description": "Document subgroup grouping documents by purpose. Narrows down the purpose defined in content_purpose_supergroup.",
            "type": "string"
        },
        "content_purpose_supergroup": {
            "description": "Document supergroup grouping documents by a purpose",
            "type": "string"
        },
        "description": {
            "type": "null"
        },
        "details": {
            "type": "object",
            "additionalProperties": false,
            "properties": {}
        },
        "document_type": {
            "type": "string",
            "enum": [
                "redirect"
            ]
        },
        "email_document_supertype": {
            "description": "Document supertype grouping intended to power the Whitehall finders and email subscriptions",
            "type": "string"
        },
        "expanded_links": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "available_translations": {
                    "description": "Link type automatically added by Publishing API",
                    "$ref": "#/definitions/frontend_links_with_base_path"
                },
                "child_taxons": {
                    "description": "Link type automatically added by Publishing API",
                    "$ref": "#/definitions/frontend_links_with_base_path"
                },
                "children": {
                    "description": "Link type automatically added by Publishing API",
                    "$ref": "#/definitions/frontend_links_with_base_path"
                },
                "document_collections": {
                    "description": "Link type automatically added by Publishing API",
                    "$ref": "#/definitions/frontend_links_with_base_path"
                },
                "level_one_taxons": {
                    "description": "Link type automatically added by Publishing API",
                    "$ref": "#/definitions/frontend_links_with_base_path"
                },
                "ministers": {
                    "description": "Link type automatically added by Publishing API",
                    "$ref": "#/definitions/frontend_links"
                },
                "part_of_step_navs": {
                    "description": "Link type automatically added by Publishing API",
                    "$ref": "#/definitions/frontend_links_with_base_path"
                },
                "policies": {
                    "description": "Link type automatically added by Publishing API",
                    "$ref": "#/definitions/frontend_links_with_base_path"
                },
                "related_to_step_navs": {
                    "description": "Link type automatically added by Publishing API",
                    "$ref": "#/definitions/frontend_links_with_base_path"
                },
                "role_appointments": {
                    "description": "Link type automatically added by Publishing API",
                    "$ref": "#/definitions/frontend_links"
                },
                "secondary_to_step_navs": {
                    "description": "Link type automatically added by Publishing API",
                    "$ref": "#/definitions/frontend_links_with_base_path"
                },
                "topic_taxonomy_taxons": {
                    "description": "Link type automatically added by Publishing API",
                    "$ref": "#/definitions/frontend_links_with_base_path"
                }
            }
        },
        "first_published_at": {
            "$ref": "#/definitions/first_published_at"
        },
        "government_document_supertype": {
            "description": "Document supertype grouping intended to power the Whitehall finders and email subscriptions",
            "type": "string"
        },
        "govuk_request_id": {
            "$ref": "#/definitions/govuk_request_id"
        },
        "links": {
            "type": "object",
            "additionalProperties": false,
            "properties": {}
        },
        "locale": {
            "$ref": "#/definitions/locale"
        },
        "navigation_document_supertype": {
            "description": "Document type grouping powering the new taxonomy-based navigation pages",
            "type": "string"
        },
        "need_ids": {
            "type": "array",
            "items": {
                "type": "string"
            }
        },
        "payload_version": {
            "$ref": "#/definitions/payload_version"
        },
        "phase": {
            "description": "The service design phase of this content item - https://www.gov.uk/service-manual/phases",
            "type": "string",
            "enum": [
                "alpha",
                "beta",
                "live"
            ]
        },
        "public_updated_at": {
            "$ref": "#/definitions/public_updated_at"
        },
        "publishing_app": {
            "$ref": "#/definitions/publishing_app_name"
        },
        "publishing_request_id": {
            "$ref": "#/definitions/publishing_request_id"
        },
        "redirects": {
            "$ref": "#/definitions/redirects"
        },
        "rendering_app": {
            "type": "null"
        },
        "routes": {
            "type": "array",
            "additionalItems": false,
            "items": {}
        },
        "schema_name": {
            "type": "string",
            "enum": [
                "redirect"
            ]
        },
        "search_user_need_document_supertype": {
            "description": "Document supertype grouping core and government documents",
            "type": "string"
        },
        "title": {
            "type": "null"
        },
        "update_type": {
            "$ref": "#/definitions/update_type"
        },
        "user_journey_document_supertype": {
            "description": "Document type grouping powering analytics of user journeys",
            "type": "string"
        },
        "user_need_document_supertype": {
            "description": "DEPRECATED. Use `content_purpose_document_supertype`.",
            "type": "string"
        },
        "withdrawn_notice": {
            "$ref": "#/definitions/withdrawn_notice"
        }
    },
    "definitions": {
        "absolute_fullpath": {
            "description": "A path with optional query string and/or fragment.",
            "type": "string",
            "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})*)?$"
        },
        "absolute_path": {
            "description": "A path only. Query string and/or fragment are not allowed.",
            "type": "string",
            "pattern": "^/(([a-zA-Z0-9._~!$&'()*+,;=:@-]|%[0-9a-fA-F]{2})+(/([a-zA-Z0-9._~!$&'()*+,;=:@-]|%[0-9a-fA-F]{2})*)*)?$"
        },
        "analytics_identifier": {
            "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.",
            "anyOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ]
        },
        "first_published_at": {
            "description": "The date the content was first published.  Automatically determined by the publishing-api, unless overridden by the publishing application.",
            "type": "string",
            "format": "date-time"
        },
        "frontend_links": {
            "type": "array",
            "items": {
                "type": "object",
                "required": [
                    "content_id",
                    "locale",
                    "title"
                ],
                "additionalProperties": true,
                "properties": {
                    "analytics_identifier": {
                        "$ref": "#/definitions/analytics_identifier"
                    },
                    "api_path": {
                        "$ref": "#/definitions/absolute_path"
                    },
                    "api_url": {
                        "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",
                        "format": "uri"
                    },
                    "base_path": {
                        "$ref": "#/definitions/absolute_path"
                    },
                    "content_id": {
                        "$ref": "#/definitions/guid"
                    },
                    "document_type": {
                        "type": "string"
                    },
                    "links": {
                        "type": "object",
                        "patternProperties": {
                            "^[a-z_]+$": {
                                "$ref": "#/definitions/frontend_links"
                            }
                        }
                    },
                    "locale": {
                        "$ref": "#/definitions/locale"
                    },
                    "public_updated_at": {
                        "oneOf": [
                            {
                                "$ref": "#/definitions/public_updated_at"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "schema_name": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "web_url": {
                        "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",
                        "format": "uri"
                    }
                }
            }
        },
        "frontend_links_with_base_path": {
            "type": "array",
            "items": {
                "type": "object",
                "required": [
                    "base_path",
                    "content_id",
                    "locale",
                    "title"
                ],
                "additionalProperties": true,
                "properties": {
                    "analytics_identifier": {
                        "$ref": "#/definitions/analytics_identifier"
                    },
                    "api_path": {
                        "$ref": "#/definitions/absolute_path"
                    },
                    "api_url": {
                        "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",
                        "format": "uri"
                    },
                    "base_path": {
                        "$ref": "#/definitions/absolute_path"
                    },
                    "content_id": {
                        "$ref": "#/definitions/guid"
                    },
                    "document_type": {
                        "type": "string"
                    },
                    "links": {
                        "type": "object",
                        "patternProperties": {
                            "^[a-z_]+$": {
                                "$ref": "#/definitions/frontend_links_with_base_path"
                            }
                        }
                    },
                    "locale": {
                        "$ref": "#/definitions/locale"
                    },
                    "public_updated_at": {
                        "oneOf": [
                            {
                                "$ref": "#/definitions/public_updated_at"
                            },
                            {
                                "type": "null"
                            }
                        ]
                    },
                    "schema_name": {
                        "type": "string"
                    },
                    "title": {
                        "type": "string"
                    },
                    "web_url": {
                        "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",
                        "format": "uri"
                    }
                }
            }
        },
        "govuk_request_id": {
            "type": [
                "string",
                "null"
            ]
        },
        "govuk_subdomain_url": {
            "description": "A URL under the gov.uk domain with optional query string and/or fragment.",
            "type": "string",
            "pattern": "^https://([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[A-Za-z0-9])?\\.)*gov\\.uk(/(([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})*)?)?$"
        },
        "guid": {
            "type": "string",
            "pattern": "^[a-f0-9]{8}-[a-f0-9]{4}-[1-5][a-f0-9]{3}-[89ab][a-f0-9]{3}-[a-f0-9]{12}$"
        },
        "locale": {
            "type": "string",
            "enum": [
                "ar",
                "az",
                "be",
                "bg",
                "bn",
                "cs",
                "cy",
                "da",
                "de",
                "dr",
                "el",
                "en",
                "es",
                "es-419",
                "et",
                "fa",
                "fi",
                "fr",
                "gd",
                "he",
                "hi",
                "hr",
                "hu",
                "hy",
                "id",
                "is",
                "it",
                "ja",
                "ka",
                "kk",
                "ko",
                "lt",
                "lv",
                "ms",
                "mt",
                "nl",
                "no",
                "pl",
                "ps",
                "pt",
                "ro",
                "ru",
                "si",
                "sk",
                "sl",
                "so",
                "sq",
                "sr",
                "sv",
                "sw",
                "ta",
                "th",
                "tk",
                "tr",
                "uk",
                "ur",
                "uz",
                "vi",
                "zh",
                "zh-hk",
                "zh-tw"
            ]
        },
        "payload_version": {
            "description": "Counter to indicate when the payload was generated",
            "type": "integer"
        },
        "public_updated_at": {
            "description": "When the content was last significantly changed (a major update). Shown to users.  Automatically determined by the publishing-api, unless overridden by the publishing application.",
            "type": "string",
            "format": "date-time"
        },
        "publishing_app_name": {
            "description": "The application that published this item.",
            "type": "string",
            "enum": [
                "calculators",
                "calendars",
                "collections-publisher",
                "contacts",
                "content-publisher",
                "content-tagger",
                "email-alert-frontend",
                "external-link-tracker",
                "feedback",
                "frontend",
                "government-frontend",
                "hmrc-manuals-api",
                "info-frontend",
                "licencefinder",
                "local-links-manager",
                "manuals-frontend",
                "manuals-publisher",
                "maslow",
                "performanceplatform-big-screen-view",
                "publisher",
                "rummager",
                "search-admin",
                "search-api",
                "service-manual-publisher",
                "share-sale-publisher",
                "short-url-manager",
                "smartanswers",
                "special-route-publisher",
                "specialist-publisher",
                "static",
                "tariff",
                "travel-advice-publisher",
                "whitehall"
            ]
        },
        "publishing_request_id": {
            "description": "A unique identifier used to track publishing requests to rendered content",
            "oneOf": [
                {
                    "type": "string"
                },
                {
                    "type": "null"
                }
            ]
        },
        "redirect_route": {
            "type": "object",
            "required": [
                "path",
                "type",
                "destination"
            ],
            "additionalProperties": false,
            "properties": {
                "destination": {
                    "type": "string",
                    "anyOf": [
                        {
                            "$ref": "#/definitions/absolute_fullpath"
                        },
                        {
                            "$ref": "#/definitions/govuk_subdomain_url"
                        }
                    ]
                },
                "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"
                    ]
                }
            }
        },
        "redirects": {
            "type": "array",
            "items": {
                "$ref": "#/definitions/redirect_route"
            },
            "minItems": 1
        },
        "update_type": {
            "enum": [
                "major",
                "minor",
                "republish"
            ]
        },
        "withdrawn_notice": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "explanation": {
                    "type": "string"
                },
                "withdrawn_at": {
                    "format": "date-time"
                }
            }
        }
    }
}