diff --git a/app/queries/get_content_collection.rb b/app/queries/get_content_collection.rb index bb2d763cb6..4661119650 100644 --- a/app/queries/get_content_collection.rb +++ b/app/queries/get_content_collection.rb @@ -11,7 +11,7 @@ class GetContentCollection :states, ) - def initialize(fields:, document_types: [], filters: {}, pagination: Pagination.new, search_query: "", search_in: nil) + def initialize(fields:, document_types: @document_types, filters: {}, pagination: Pagination.new, search_query: "", search_in: nil) self.document_types = Array(document_types) self.fields = (fields || default_fields) + %w[total] self.publishing_app = filters[:publishing_app] @@ -47,17 +47,13 @@ def call def editions scope = Edition.with_document - scope = scope.where(document_type: document_types) if document_types.any? + scope = scope.where(document_type: @document_types) if @document_types.any? scope = scope.where(publishing_app:) if publishing_app scope = scope.where("documents.locale": locale) unless locale == "all" scope = Link.filter_editions(scope, link_filters) if link_filters.present? scope end - def document_types - @document_types.flat_map { |d| [d, "placeholder_#{d}"] } - end - def validate_fields! return unless fields diff --git a/app/queries/get_linkables.rb b/app/queries/get_linkables.rb index 7dd122a120..145d45f65e 100644 --- a/app/queries/get_linkables.rb +++ b/app/queries/get_linkables.rb @@ -18,17 +18,13 @@ def call attr_reader :document_type def latest_updated_at(document_type) - non_placeholder = Edition.where(document_type:) - .maximum("updated_at") - placeholder = Edition.where(document_type: "placeholder_#{document_type}") - .maximum("updated_at") - [non_placeholder, placeholder].compact.max + Edition.where(document_type:).maximum("updated_at") end def linkables_query(document_type) Edition.with_document .where( - document_type: [document_type, "placeholder_#{document_type}"], + document_type:, state: %w[published draft], "documents.locale": "en", ) diff --git a/app/validators/schema_validator.rb b/app/validators/schema_validator.rb index 2cc6bbfc02..a65bb2bd41 100644 --- a/app/validators/schema_validator.rb +++ b/app/validators/schema_validator.rb @@ -13,8 +13,6 @@ def initialize(payload:, schema: nil, schema_name: nil, schema_type: :publisher) end def valid? - return true if schema_name_exception? - @errors += JSON::Validator.fully_validate( schema, payload, @@ -55,10 +53,6 @@ def schema_name @schema_name || payload[:schema_name] end - def schema_name_exception? - schema_name.to_s.match(/placeholder_/) - end - def missing_schema_message "Unable to find schema for schema_name #{schema_name}" end diff --git a/content_schemas/dist/formats/placeholder/frontend/schema.json b/content_schemas/dist/formats/placeholder/frontend/schema.json deleted file mode 100644 index 48b9c954f5..0000000000 --- a/content_schemas/dist/formats/placeholder/frontend/schema.json +++ /dev/null @@ -1,968 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "required": [ - "base_path", - "content_id", - "description", - "details", - "document_type", - "links", - "locale", - "public_updated_at", - "schema_name", - "title", - "updated_at" - ], - "additionalProperties": false, - "properties": { - "analytics_identifier": { - "$ref": "#/definitions/analytics_identifier" - }, - "base_path": { - "$ref": "#/definitions/absolute_path" - }, - "content_id": { - "$ref": "#/definitions/guid" - }, - "description": { - "$ref": "#/definitions/description_optional" - }, - "details": { - "$ref": "#/definitions/details" - }, - "document_type": { - "type": "string", - "enum": [ - "aaib_report", - "about", - "about_our_services", - "accessible_documents_policy", - "access_and_opening", - "ai_assurance_portfolio_technique", - "ambassador_role", - "animal_disease_case", - "answer", - "asylum_support_decision", - "authored_article", - "board_member_role", - "business_finance_support_scheme", - "calendar", - "call_for_evidence", - "call_for_evidence_outcome", - "case_study", - "chief_professional_officer_role", - "chief_scientific_officer_role", - "chief_scientific_advisor_role", - "closed_call_for_evidence", - "closed_consultation", - "cma_case", - "complaints_procedure", - "completed_transaction", - "consultation", - "consultation_outcome", - "contact", - "coronavirus_landing_page", - "corporate_report", - "correspondence", - "countryside_stewardship_grant", - "decision", - "deputy_head_of_mission_role", - "detailed_guide", - "document_collection", - "drcf_digital_markets_research", - "drug_safety_update", - "email_alert_signup", - "embassies_index", - "employment_appeal_tribunal_decision", - "employment_tribunal_decision", - "equality_and_diversity", - "esi_fund", - "export_health_certificate", - "external_content", - "facet", - "fatality_notice", - "field_of_operation", - "fields_of_operation", - "finder", - "finder_email_signup", - "flood_and_coastal_erosion_risk_management_research_report", - "foi_release", - "form", - "get_involved", - "gone", - "government", - "government_response", - "governor_role", - "guidance", - "guide", - "help_page", - "high_commissioner_role", - "historic_appointment", - "historic_appointments", - "history", - "hmrc_manual", - "hmrc_manual_section", - "homepage", - "how_government_works", - "html_publication", - "impact_assessment", - "independent_report", - "international_development_fund", - "international_treaty", - "licence", - "license_finder", - "licence_transaction", - "local_transaction", - "maib_report", - "mainstream_browse_page", - "marine_equipment_approved_recommendation", - "manual", - "manual_section", - "map", - "marine_notice", - "media_enquiries", - "medical_safety_alert", - "membership", - "military_role", - "ministerial_role", - "ministers_index", - "modern_slavery_statement", - "national", - "national_statistics", - "national_statistics_announcement", - "need", - "news_story", - "notice", - "official", - "official_statistics", - "official_statistics_announcement", - "oim_project", - "open_call_for_evidence", - "open_consultation", - "oral_statement", - "organisation", - "our_energy_use", - "our_governance", - "person", - "personal_information_charter", - "petitions_and_campaigns", - "place", - "placeholder", - "policy_paper", - "press_release", - "procurement", - "product_safety_alert_report_recall", - "promotional", - "protected_food_drink_name", - "publication_scheme", - "raib_report", - "recruitment", - "redirect", - "regulation", - "research", - "research_for_development_output", - "residential_property_tribunal_decision", - "role_appointment", - "search", - "service_manual_guide", - "service_manual_homepage", - "service_manual_service_standard", - "service_manual_service_toolkit", - "service_manual_topic", - "service_sign_in", - "service_standard_report", - "services_and_information", - "simple_smart_answer", - "smart_answer", - "social_media_use", - "special_representative_role", - "special_route", - "speech", - "staff_update", - "standard", - "statistical_data_set", - "statistics", - "statistics_announcement", - "statutory_guidance", - "statutory_instrument", - "step_by_step_nav", - "take_part", - "tax_tribunal_decision", - "taxon", - "terms_of_reference", - "topic", - "topical_event", - "topical_event_about_page", - "traffic_commissioner_regulatory_decision", - "traffic_commissioner_role", - "transaction", - "transparency", - "travel_advice", - "travel_advice_index", - "uk_market_conformity_assessment_body", - "utaac_decision", - "vanish", - "welsh_language_scheme", - "working_group", - "world_index", - "world_location", - "world_location_news", - "world_news_story", - "worldwide_office_staff_role", - "worldwide_office", - "worldwide_organisation", - "written_statement" - ] - }, - "first_published_at": { - "anyOf": [ - { - "$ref": "#/definitions/first_published_at" - }, - { - "type": "null" - } - ] - }, - "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" - }, - "featured_policies": { - "description": "Featured policies primarily for use with Whitehall organisations. Deprecated in favour of ordered_featured_policies.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "finder": { - "description": "Powers links from content back to finders the content is surfaced on", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "lead_organisations": { - "description": "DEPRECATED: A subset of organisations that should be emphasised in relation to this content item. All organisations specified here should also be part of the organisations array.", - "$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" - }, - "mainstream_browse_pages": { - "description": "Powers the /browse section of the site. These are known as sections in some legacy apps.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "meets_user_needs": { - "description": "The user needs this piece of content meets.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "ministers": { - "description": "Link type automatically added by Publishing API", - "$ref": "#/definitions/frontend_links" - }, - "ordered_related_items": { - "description": "Related items, can be any page on GOV.UK. Mostly used for mainstream content to power the sidebar. Ordering of the links is determined by the editor in Content Tagger.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "ordered_related_items_overrides": { - "description": "Related items, can be any page on GOV.UK. Overrides 'more like this' automatically generated links in the beta navigation.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "organisations": { - "description": "All organisations linked to this content item. This should include lead organisations.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "original_primary_publishing_organisation": { - "description": "The organisation that published the original version of the page. Corresponds to the first of the 'Lead organisations' in Whitehall for the first edition, and is empty for all other publishing applications.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "parent": { - "description": "The parent content item.", - "$ref": "#/definitions/frontend_links_with_base_path", - "maxItems": 1 - }, - "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" - }, - "policy_areas": { - "description": "A largely deprecated tag currently only used to power email alerts.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "primary_publishing_organisation": { - "description": "The organisation that published the page. Corresponds to the first of the 'Lead organisations' in Whitehall, and is empty for all other publishing applications.", - "$ref": "#/definitions/frontend_links_with_base_path", - "maxItems": 1 - }, - "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" - }, - "suggested_ordered_related_items": { - "description": "Used for displaying related content on most pages, except for step-by-step and fatality notices. Links and their ordering are determined by the machine learning algorithms.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "taxons": { - "description": "Prototype-stage taxonomy label for this content item", - "$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" - }, - "topics": { - "description": "Powers the /topic section of the site. These are known as specialist sectors in some legacy apps.", - "$ref": "#/definitions/frontend_links_with_base_path" - } - } - }, - "locale": { - "$ref": "#/definitions/locale" - }, - "need_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "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": { - "anyOf": [ - { - "$ref": "#/definitions/public_updated_at" - }, - { - "type": "null" - } - ] - }, - "publishing_app": { - "$ref": "#/definitions/publishing_app_name" - }, - "publishing_request_id": { - "$ref": "#/definitions/publishing_request_id" - }, - "publishing_scheduled_at": { - "anyOf": [ - { - "$ref": "#/definitions/publishing_scheduled_at" - }, - { - "type": "null" - } - ] - }, - "rendering_app": { - "$ref": "#/definitions/rendering_app" - }, - "scheduled_publishing_delay_seconds": { - "anyOf": [ - { - "$ref": "#/definitions/scheduled_publishing_delay_seconds" - }, - { - "type": "null" - } - ] - }, - "schema_name": { - "description": "Should be of the form 'placeholder_my_format_name'. 'placeholder' is allowed for backwards compatibility.", - "type": "string", - "pattern": "^(placeholder|placeholder_.+)$" - }, - "title": { - "$ref": "#/definitions/title" - }, - "updated_at": { - "type": "string", - "format": "date-time" - }, - "withdrawn_notice": { - "$ref": "#/definitions/withdrawn_notice" - } - }, - "definitions": { - "description": { - "type": "string" - }, - "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" - } - ] - }, - "change_history": { - "type": "array", - "items": { - "type": "object", - "required": [ - "public_timestamp", - "note" - ], - "additionalProperties": false, - "properties": { - "note": { - "description": "A summary of the change", - "type": "string" - }, - "public_timestamp": { - "type": "string", - "format": "date-time" - } - } - } - }, - "change_note": { - "description": "Change note for the most recent update", - "type": [ - "string", - "null" - ] - }, - "description_optional": { - "anyOf": [ - { - "$ref": "#/definitions/description" - }, - { - "type": "null" - } - ] - }, - "details": { - "type": "object", - "additionalProperties": false, - "properties": { - "analytics_identifier": { - "$ref": "#/definitions/analytics_identifier" - }, - "brand": { - "description": "Used for organisations, to allow us to publish branding / logo information. Remove when organisations are migrated.", - "type": [ - "string", - "null" - ] - }, - "change_history": { - "$ref": "#/definitions/change_history" - }, - "change_note": { - "$ref": "#/definitions/change_note" - }, - "end_date": { - "description": "Used for topical events, so that related documents can get the date. Remove when topical events are migrated.", - "type": "string", - "format": "date-time" - }, - "external_related_links": { - "$ref": "#/definitions/external_related_links" - }, - "logo": { - "description": "Used for organisations, to allow us to publish branding / logo information. Remove when organisations are migrated.", - "type": "object", - "properties": { - "crest": { - "type": [ - "string", - "null" - ], - "enum": [ - "bis", - "dbt", - "eo", - "hmrc", - "ho", - "mod", - "portcullis", - "single-identity", - "so", - "ukaea", - "wales", - null - ] - }, - "formatted_title": { - "type": "string" - }, - "image": { - "$ref": "#/definitions/image" - } - } - }, - "start_date": { - "description": "Used for topical events, so that related documents can get the date. Remove when topical events are migrated.", - "type": "string", - "format": "date-time" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "external_link": { - "type": "object", - "required": [ - "title", - "url" - ], - "additionalProperties": false, - "properties": { - "title": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - } - } - }, - "external_related_links": { - "type": "array", - "items": { - "$ref": "#/definitions/external_link" - } - }, - "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" - } - } - } - }, - "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}$" - }, - "image": { - "type": "object", - "required": [ - "url" - ], - "additionalProperties": false, - "properties": { - "alt_text": { - "type": "string" - }, - "caption": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "credit": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "high_resolution_url": { - "description": "URL to a high resolution version of the image, for use by third parties such as Twitter, Facebook or Slack. Used by the machine readable metadata component. Don't use this on user-facing web pages, as it might be very large.", - "type": "string", - "format": "uri" - }, - "url": { - "description": "URL to the image. The image should be in a suitable resolution for display on the page.", - "type": "string", - "format": "uri" - } - } - }, - "locale": { - "type": "string", - "enum": [ - "ar", - "az", - "be", - "bg", - "bn", - "cs", - "cy", - "da", - "de", - "dr", - "el", - "en", - "es", - "es-419", - "et", - "fa", - "fi", - "fr", - "gd", - "gu", - "he", - "hi", - "hr", - "hu", - "hy", - "id", - "is", - "it", - "ja", - "ka", - "kk", - "ko", - "lt", - "lv", - "ms", - "mt", - "ne", - "nl", - "no", - "pa", - "pa-pk", - "pl", - "ps", - "pt", - "ro", - "ru", - "si", - "sk", - "sl", - "so", - "sq", - "sr", - "sv", - "sw", - "ta", - "th", - "tk", - "tr", - "uk", - "ur", - "uz", - "vi", - "yi", - "zh", - "zh-hk", - "zh-tw" - ] - }, - "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": [ - "account-api", - "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-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" - } - ] - }, - "publishing_scheduled_at": { - "description": "When this content was last scheduled for publishing. Determined by the publishing intent sent by the publishing API.", - "type": "string", - "format": "date-time" - }, - "rendering_app": { - "description": "The application that renders this item.", - "type": "string", - "enum": [ - "account-api", - "calculators", - "calendars", - "collections", - "content-store", - "email-alert-frontend", - "email-campaign-frontend", - "feedback", - "finder-frontend", - "frontend", - "government-frontend", - "info-frontend", - "licencefinder", - "performanceplatform-big-screen-view", - "rummager", - "search-api", - "smartanswers", - "spotlight", - "static", - "tariff", - "whitehall-admin", - "whitehall-frontend" - ] - }, - "scheduled_publishing_delay_seconds": { - "description": "The delay between the most recent scheduled and actual publishing times. Determined by the content store based on the publishing intent.", - "type": "integer" - }, - "tags": { - "description": "Field used by email-alert-api to trigger email alerts for subscriptions to topics (gov.uk/topic) and policies (gov.uk/policies).", - "type": "object", - "additionalProperties": false, - "properties": { - "additional_topics": { - "type": "array", - "items": { - "type": "string" - } - }, - "browse_pages": { - "type": "array", - "items": { - "type": "string" - } - }, - "policies": { - "type": "array", - "items": { - "type": "string" - } - }, - "primary_topic": { - "type": "array", - "items": { - "type": "string" - } - }, - "topics": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "title": { - "type": "string" - }, - "withdrawn_notice": { - "type": "object", - "additionalProperties": false, - "properties": { - "explanation": { - "type": "string" - }, - "withdrawn_at": { - "format": "date-time" - } - } - } - } -} diff --git a/content_schemas/dist/formats/placeholder/notification/schema.json b/content_schemas/dist/formats/placeholder/notification/schema.json deleted file mode 100644 index 457143fa52..0000000000 --- a/content_schemas/dist/formats/placeholder/notification/schema.json +++ /dev/null @@ -1,1104 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "required": [ - "analytics_identifier", - "base_path", - "content_id", - "description", - "details", - "document_type", - "email_document_supertype", - "expanded_links", - "first_published_at", - "government_document_supertype", - "govuk_request_id", - "links", - "locale", - "payload_version", - "phase", - "public_updated_at", - "publishing_app", - "redirects", - "rendering_app", - "routes", - "schema_name", - "title", - "update_type" - ], - "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": { - "$ref": "#/definitions/description_optional" - }, - "details": { - "$ref": "#/definitions/details" - }, - "document_type": { - "type": "string", - "enum": [ - "aaib_report", - "about", - "about_our_services", - "accessible_documents_policy", - "access_and_opening", - "ai_assurance_portfolio_technique", - "ambassador_role", - "animal_disease_case", - "answer", - "asylum_support_decision", - "authored_article", - "board_member_role", - "business_finance_support_scheme", - "calendar", - "call_for_evidence", - "call_for_evidence_outcome", - "case_study", - "chief_professional_officer_role", - "chief_scientific_officer_role", - "chief_scientific_advisor_role", - "closed_call_for_evidence", - "closed_consultation", - "cma_case", - "complaints_procedure", - "completed_transaction", - "consultation", - "consultation_outcome", - "contact", - "coronavirus_landing_page", - "corporate_report", - "correspondence", - "countryside_stewardship_grant", - "decision", - "deputy_head_of_mission_role", - "detailed_guide", - "document_collection", - "drcf_digital_markets_research", - "drug_safety_update", - "email_alert_signup", - "embassies_index", - "employment_appeal_tribunal_decision", - "employment_tribunal_decision", - "equality_and_diversity", - "esi_fund", - "export_health_certificate", - "external_content", - "facet", - "fatality_notice", - "field_of_operation", - "fields_of_operation", - "finder", - "finder_email_signup", - "flood_and_coastal_erosion_risk_management_research_report", - "foi_release", - "form", - "get_involved", - "gone", - "government", - "government_response", - "governor_role", - "guidance", - "guide", - "help_page", - "high_commissioner_role", - "historic_appointment", - "historic_appointments", - "history", - "hmrc_manual", - "hmrc_manual_section", - "homepage", - "how_government_works", - "html_publication", - "impact_assessment", - "independent_report", - "international_development_fund", - "international_treaty", - "licence", - "license_finder", - "licence_transaction", - "local_transaction", - "maib_report", - "mainstream_browse_page", - "marine_equipment_approved_recommendation", - "manual", - "manual_section", - "map", - "marine_notice", - "media_enquiries", - "medical_safety_alert", - "membership", - "military_role", - "ministerial_role", - "ministers_index", - "modern_slavery_statement", - "national", - "national_statistics", - "national_statistics_announcement", - "need", - "news_story", - "notice", - "official", - "official_statistics", - "official_statistics_announcement", - "oim_project", - "open_call_for_evidence", - "open_consultation", - "oral_statement", - "organisation", - "our_energy_use", - "our_governance", - "person", - "personal_information_charter", - "petitions_and_campaigns", - "place", - "placeholder", - "policy_paper", - "press_release", - "procurement", - "product_safety_alert_report_recall", - "promotional", - "protected_food_drink_name", - "publication_scheme", - "raib_report", - "recruitment", - "redirect", - "regulation", - "research", - "research_for_development_output", - "residential_property_tribunal_decision", - "role_appointment", - "search", - "service_manual_guide", - "service_manual_homepage", - "service_manual_service_standard", - "service_manual_service_toolkit", - "service_manual_topic", - "service_sign_in", - "service_standard_report", - "services_and_information", - "simple_smart_answer", - "smart_answer", - "social_media_use", - "special_representative_role", - "special_route", - "speech", - "staff_update", - "standard", - "statistical_data_set", - "statistics", - "statistics_announcement", - "statutory_guidance", - "statutory_instrument", - "step_by_step_nav", - "take_part", - "tax_tribunal_decision", - "taxon", - "terms_of_reference", - "topic", - "topical_event", - "topical_event_about_page", - "traffic_commissioner_regulatory_decision", - "traffic_commissioner_role", - "transaction", - "transparency", - "travel_advice", - "travel_advice_index", - "uk_market_conformity_assessment_body", - "utaac_decision", - "vanish", - "welsh_language_scheme", - "working_group", - "world_index", - "world_location", - "world_location_news", - "world_news_story", - "worldwide_office_staff_role", - "worldwide_office", - "worldwide_organisation", - "written_statement" - ] - }, - "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" - }, - "featured_policies": { - "description": "Featured policies primarily for use with Whitehall organisations. Deprecated in favour of ordered_featured_policies.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "finder": { - "description": "Powers links from content back to finders the content is surfaced on", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "lead_organisations": { - "description": "DEPRECATED: A subset of organisations that should be emphasised in relation to this content item. All organisations specified here should also be part of the organisations array.", - "$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" - }, - "mainstream_browse_pages": { - "description": "Powers the /browse section of the site. These are known as sections in some legacy apps.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "meets_user_needs": { - "description": "The user needs this piece of content meets.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "ministers": { - "description": "Link type automatically added by Publishing API", - "$ref": "#/definitions/frontend_links" - }, - "ordered_related_items": { - "description": "Related items, can be any page on GOV.UK. Mostly used for mainstream content to power the sidebar. Ordering of the links is determined by the editor in Content Tagger.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "ordered_related_items_overrides": { - "description": "Related items, can be any page on GOV.UK. Overrides 'more like this' automatically generated links in the beta navigation.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "organisations": { - "description": "All organisations linked to this content item. This should include lead organisations.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "original_primary_publishing_organisation": { - "description": "The organisation that published the original version of the page. Corresponds to the first of the 'Lead organisations' in Whitehall for the first edition, and is empty for all other publishing applications.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "parent": { - "description": "The parent content item.", - "$ref": "#/definitions/frontend_links_with_base_path", - "maxItems": 1 - }, - "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" - }, - "policy_areas": { - "description": "A largely deprecated tag currently only used to power email alerts.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "primary_publishing_organisation": { - "description": "The organisation that published the page. Corresponds to the first of the 'Lead organisations' in Whitehall, and is empty for all other publishing applications.", - "$ref": "#/definitions/frontend_links_with_base_path", - "maxItems": 1 - }, - "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" - }, - "suggested_ordered_related_items": { - "description": "Used for displaying related content on most pages, except for step-by-step and fatality notices. Links and their ordering are determined by the machine learning algorithms.", - "$ref": "#/definitions/frontend_links_with_base_path" - }, - "taxons": { - "description": "Prototype-stage taxonomy label for this content item", - "$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" - }, - "topics": { - "description": "Powers the /topic section of the site. These are known as specialist sectors in some legacy apps.", - "$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": { - "featured_policies": { - "description": "Featured policies primarily for use with Whitehall organisations. Deprecated in favour of ordered_featured_policies.", - "$ref": "#/definitions/guid_list" - }, - "finder": { - "description": "Powers links from content back to finders the content is surfaced on", - "$ref": "#/definitions/guid_list" - }, - "lead_organisations": { - "description": "DEPRECATED: A subset of organisations that should be emphasised in relation to this content item. All organisations specified here should also be part of the organisations array.", - "$ref": "#/definitions/guid_list" - }, - "mainstream_browse_pages": { - "description": "Powers the /browse section of the site. These are known as sections in some legacy apps.", - "$ref": "#/definitions/guid_list" - }, - "meets_user_needs": { - "description": "The user needs this piece of content meets.", - "$ref": "#/definitions/guid_list" - }, - "ordered_related_items": { - "description": "Related items, can be any page on GOV.UK. Mostly used for mainstream content to power the sidebar. Ordering of the links is determined by the editor in Content Tagger.", - "$ref": "#/definitions/guid_list" - }, - "ordered_related_items_overrides": { - "description": "Related items, can be any page on GOV.UK. Overrides 'more like this' automatically generated links in the beta navigation.", - "$ref": "#/definitions/guid_list" - }, - "organisations": { - "description": "All organisations linked to this content item. This should include lead organisations.", - "$ref": "#/definitions/guid_list" - }, - "original_primary_publishing_organisation": { - "description": "The organisation that published the original version of the page. Corresponds to the first of the 'Lead organisations' in Whitehall for the first edition, and is empty for all other publishing applications.", - "$ref": "#/definitions/guid_list" - }, - "parent": { - "description": "The parent content item.", - "$ref": "#/definitions/guid_list", - "maxItems": 1 - }, - "policy_areas": { - "description": "A largely deprecated tag currently only used to power email alerts.", - "$ref": "#/definitions/guid_list" - }, - "primary_publishing_organisation": { - "description": "The organisation that published the page. Corresponds to the first of the 'Lead organisations' in Whitehall, and is empty for all other publishing applications.", - "$ref": "#/definitions/guid_list", - "maxItems": 1 - }, - "suggested_ordered_related_items": { - "description": "Used for displaying related content on most pages, except for step-by-step and fatality notices. Links and their ordering are determined by the machine learning algorithms.", - "$ref": "#/definitions/guid_list" - }, - "taxons": { - "description": "Prototype-stage taxonomy label for this content item", - "$ref": "#/definitions/guid_list" - }, - "topics": { - "description": "Powers the /topic section of the site. These are known as specialist sectors in some legacy apps.", - "$ref": "#/definitions/guid_list" - } - } - }, - "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": { - "type": "array", - "additionalItems": false, - "items": {} - }, - "rendering_app": { - "$ref": "#/definitions/rendering_app" - }, - "routes": { - "$ref": "#/definitions/routes" - }, - "schema_name": { - "description": "Should be of the form 'placeholder_my_format_name'. 'placeholder' is allowed for backwards compatibility.", - "type": "string", - "pattern": "^(placeholder|placeholder_.+)$" - }, - "search_user_need_document_supertype": { - "description": "Document supertype grouping core and government documents", - "type": "string" - }, - "title": { - "$ref": "#/definitions/title" - }, - "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": { - "description": { - "type": "string" - }, - "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" - } - ] - }, - "change_history": { - "type": "array", - "items": { - "type": "object", - "required": [ - "public_timestamp", - "note" - ], - "additionalProperties": false, - "properties": { - "note": { - "description": "A summary of the change", - "type": "string" - }, - "public_timestamp": { - "type": "string", - "format": "date-time" - } - } - } - }, - "change_note": { - "description": "Change note for the most recent update", - "type": [ - "string", - "null" - ] - }, - "description_optional": { - "anyOf": [ - { - "$ref": "#/definitions/description" - }, - { - "type": "null" - } - ] - }, - "details": { - "type": "object", - "additionalProperties": false, - "properties": { - "analytics_identifier": { - "$ref": "#/definitions/analytics_identifier" - }, - "brand": { - "description": "Used for organisations, to allow us to publish branding / logo information. Remove when organisations are migrated.", - "type": [ - "string", - "null" - ] - }, - "change_history": { - "$ref": "#/definitions/change_history" - }, - "change_note": { - "$ref": "#/definitions/change_note" - }, - "end_date": { - "description": "Used for topical events, so that related documents can get the date. Remove when topical events are migrated.", - "type": "string", - "format": "date-time" - }, - "external_related_links": { - "$ref": "#/definitions/external_related_links" - }, - "logo": { - "description": "Used for organisations, to allow us to publish branding / logo information. Remove when organisations are migrated.", - "type": "object", - "properties": { - "crest": { - "type": [ - "string", - "null" - ], - "enum": [ - "bis", - "dbt", - "eo", - "hmrc", - "ho", - "mod", - "portcullis", - "single-identity", - "so", - "ukaea", - "wales", - null - ] - }, - "formatted_title": { - "type": "string" - }, - "image": { - "$ref": "#/definitions/image" - } - } - }, - "start_date": { - "description": "Used for topical events, so that related documents can get the date. Remove when topical events are migrated.", - "type": "string", - "format": "date-time" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "external_link": { - "type": "object", - "required": [ - "title", - "url" - ], - "additionalProperties": false, - "properties": { - "title": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - } - } - }, - "external_related_links": { - "type": "array", - "items": { - "$ref": "#/definitions/external_link" - } - }, - "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" - ] - }, - "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}$" - }, - "guid_list": { - "type": "array", - "items": { - "$ref": "#/definitions/guid" - }, - "uniqueItems": true - }, - "image": { - "type": "object", - "required": [ - "url" - ], - "additionalProperties": false, - "properties": { - "alt_text": { - "type": "string" - }, - "caption": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "credit": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "high_resolution_url": { - "description": "URL to a high resolution version of the image, for use by third parties such as Twitter, Facebook or Slack. Used by the machine readable metadata component. Don't use this on user-facing web pages, as it might be very large.", - "type": "string", - "format": "uri" - }, - "url": { - "description": "URL to the image. The image should be in a suitable resolution for display on the page.", - "type": "string", - "format": "uri" - } - } - }, - "locale": { - "type": "string", - "enum": [ - "ar", - "az", - "be", - "bg", - "bn", - "cs", - "cy", - "da", - "de", - "dr", - "el", - "en", - "es", - "es-419", - "et", - "fa", - "fi", - "fr", - "gd", - "gu", - "he", - "hi", - "hr", - "hu", - "hy", - "id", - "is", - "it", - "ja", - "ka", - "kk", - "ko", - "lt", - "lv", - "ms", - "mt", - "ne", - "nl", - "no", - "pa", - "pa-pk", - "pl", - "ps", - "pt", - "ro", - "ru", - "si", - "sk", - "sl", - "so", - "sq", - "sr", - "sv", - "sw", - "ta", - "th", - "tk", - "tr", - "uk", - "ur", - "uz", - "vi", - "yi", - "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": [ - "account-api", - "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-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" - } - ] - }, - "rendering_app": { - "description": "The application that renders this item.", - "type": "string", - "enum": [ - "account-api", - "calculators", - "calendars", - "collections", - "content-store", - "email-alert-frontend", - "email-campaign-frontend", - "feedback", - "finder-frontend", - "frontend", - "government-frontend", - "info-frontend", - "licencefinder", - "performanceplatform-big-screen-view", - "rummager", - "search-api", - "smartanswers", - "spotlight", - "static", - "tariff", - "whitehall-admin", - "whitehall-frontend" - ] - }, - "route": { - "type": "object", - "required": [ - "path", - "type" - ], - "additionalProperties": false, - "properties": { - "path": { - "type": "string" - }, - "type": { - "enum": [ - "prefix", - "exact" - ] - } - } - }, - "routes": { - "type": "array", - "items": { - "$ref": "#/definitions/route" - }, - "minItems": 1 - }, - "tags": { - "description": "Field used by email-alert-api to trigger email alerts for subscriptions to topics (gov.uk/topic) and policies (gov.uk/policies).", - "type": "object", - "additionalProperties": false, - "properties": { - "additional_topics": { - "type": "array", - "items": { - "type": "string" - } - }, - "browse_pages": { - "type": "array", - "items": { - "type": "string" - } - }, - "policies": { - "type": "array", - "items": { - "type": "string" - } - }, - "primary_topic": { - "type": "array", - "items": { - "type": "string" - } - }, - "topics": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "title": { - "type": "string" - }, - "update_type": { - "enum": [ - "major", - "minor", - "republish" - ] - }, - "withdrawn_notice": { - "type": "object", - "additionalProperties": false, - "properties": { - "explanation": { - "type": "string" - }, - "withdrawn_at": { - "format": "date-time" - } - } - } - } -} diff --git a/content_schemas/dist/formats/placeholder/publisher_v2/links.json b/content_schemas/dist/formats/placeholder/publisher_v2/links.json deleted file mode 100644 index 78d27f1132..0000000000 --- a/content_schemas/dist/formats/placeholder/publisher_v2/links.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "additionalProperties": false, - "properties": { - "bulk_publishing": { - "type": "boolean" - }, - "links": { - "type": "object", - "additionalProperties": false, - "properties": { - "finder": { - "description": "Powers links from content back to finders the content is surfaced on", - "$ref": "#/definitions/guid_list" - }, - "lead_organisations": { - "description": "DEPRECATED: A subset of organisations that should be emphasised in relation to this content item. All organisations specified here should also be part of the organisations array.", - "$ref": "#/definitions/guid_list" - }, - "mainstream_browse_pages": { - "description": "Powers the /browse section of the site. These are known as sections in some legacy apps.", - "$ref": "#/definitions/guid_list" - }, - "meets_user_needs": { - "description": "The user needs this piece of content meets.", - "$ref": "#/definitions/guid_list" - }, - "ordered_related_items": { - "description": "Related items, can be any page on GOV.UK. Mostly used for mainstream content to power the sidebar. Ordering of the links is determined by the editor in Content Tagger.", - "$ref": "#/definitions/guid_list" - }, - "ordered_related_items_overrides": { - "description": "Related items, can be any page on GOV.UK. Overrides 'more like this' automatically generated links in the beta navigation.", - "$ref": "#/definitions/guid_list" - }, - "organisations": { - "description": "All organisations linked to this content item. This should include lead organisations.", - "$ref": "#/definitions/guid_list" - }, - "original_primary_publishing_organisation": { - "description": "The organisation that published the original version of the page. Corresponds to the first of the 'Lead organisations' in Whitehall for the first edition, and is empty for all other publishing applications.", - "$ref": "#/definitions/guid_list" - }, - "parent": { - "description": "The parent content item.", - "$ref": "#/definitions/guid_list", - "maxItems": 1 - }, - "policy_areas": { - "description": "A largely deprecated tag currently only used to power email alerts.", - "$ref": "#/definitions/guid_list" - }, - "primary_publishing_organisation": { - "description": "The organisation that published the page. Corresponds to the first of the 'Lead organisations' in Whitehall, and is empty for all other publishing applications.", - "$ref": "#/definitions/guid_list", - "maxItems": 1 - }, - "suggested_ordered_related_items": { - "description": "Used for displaying related content on most pages, except for step-by-step and fatality notices. Links and their ordering are determined by the machine learning algorithms.", - "$ref": "#/definitions/guid_list" - }, - "taxons": { - "description": "Prototype-stage taxonomy label for this content item", - "$ref": "#/definitions/guid_list" - }, - "topics": { - "description": "Powers the /topic section of the site. These are known as specialist sectors in some legacy apps.", - "$ref": "#/definitions/guid_list" - } - } - }, - "previous_version": { - "type": "string" - } - }, - "definitions": { - "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}$" - }, - "guid_list": { - "type": "array", - "items": { - "$ref": "#/definitions/guid" - }, - "uniqueItems": true - } - } -} diff --git a/content_schemas/dist/formats/placeholder/publisher_v2/schema.json b/content_schemas/dist/formats/placeholder/publisher_v2/schema.json deleted file mode 100644 index 10a81a06f0..0000000000 --- a/content_schemas/dist/formats/placeholder/publisher_v2/schema.json +++ /dev/null @@ -1,722 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-04/schema#", - "type": "object", - "required": [ - "base_path", - "details", - "document_type", - "publishing_app", - "rendering_app", - "routes", - "schema_name", - "title" - ], - "additionalProperties": false, - "properties": { - "access_limited": { - "$ref": "#/definitions/access_limited" - }, - "analytics_identifier": { - "$ref": "#/definitions/analytics_identifier" - }, - "auth_bypass_ids": { - "description": "A list of ids that will allow access to this item for non-authenticated users", - "$ref": "#/definitions/guid_list" - }, - "base_path": { - "$ref": "#/definitions/absolute_path" - }, - "bulk_publishing": { - "type": "boolean" - }, - "change_note": { - "type": [ - "null", - "string" - ] - }, - "description": { - "$ref": "#/definitions/description_optional" - }, - "details": { - "$ref": "#/definitions/details" - }, - "document_type": { - "type": "string", - "enum": [ - "aaib_report", - "about", - "about_our_services", - "accessible_documents_policy", - "access_and_opening", - "ai_assurance_portfolio_technique", - "ambassador_role", - "animal_disease_case", - "answer", - "asylum_support_decision", - "authored_article", - "board_member_role", - "business_finance_support_scheme", - "calendar", - "call_for_evidence", - "call_for_evidence_outcome", - "case_study", - "chief_professional_officer_role", - "chief_scientific_officer_role", - "chief_scientific_advisor_role", - "closed_call_for_evidence", - "closed_consultation", - "cma_case", - "complaints_procedure", - "completed_transaction", - "consultation", - "consultation_outcome", - "contact", - "coronavirus_landing_page", - "corporate_report", - "correspondence", - "countryside_stewardship_grant", - "decision", - "deputy_head_of_mission_role", - "detailed_guide", - "document_collection", - "drcf_digital_markets_research", - "drug_safety_update", - "email_alert_signup", - "embassies_index", - "employment_appeal_tribunal_decision", - "employment_tribunal_decision", - "equality_and_diversity", - "esi_fund", - "export_health_certificate", - "external_content", - "facet", - "fatality_notice", - "field_of_operation", - "fields_of_operation", - "finder", - "finder_email_signup", - "flood_and_coastal_erosion_risk_management_research_report", - "foi_release", - "form", - "get_involved", - "gone", - "government", - "government_response", - "governor_role", - "guidance", - "guide", - "help_page", - "high_commissioner_role", - "historic_appointment", - "historic_appointments", - "history", - "hmrc_manual", - "hmrc_manual_section", - "homepage", - "how_government_works", - "html_publication", - "impact_assessment", - "independent_report", - "international_development_fund", - "international_treaty", - "licence", - "license_finder", - "licence_transaction", - "local_transaction", - "maib_report", - "mainstream_browse_page", - "marine_equipment_approved_recommendation", - "manual", - "manual_section", - "map", - "marine_notice", - "media_enquiries", - "medical_safety_alert", - "membership", - "military_role", - "ministerial_role", - "ministers_index", - "modern_slavery_statement", - "national", - "national_statistics", - "national_statistics_announcement", - "need", - "news_story", - "notice", - "official", - "official_statistics", - "official_statistics_announcement", - "oim_project", - "open_call_for_evidence", - "open_consultation", - "oral_statement", - "organisation", - "our_energy_use", - "our_governance", - "person", - "personal_information_charter", - "petitions_and_campaigns", - "place", - "placeholder", - "policy_paper", - "press_release", - "procurement", - "product_safety_alert_report_recall", - "promotional", - "protected_food_drink_name", - "publication_scheme", - "raib_report", - "recruitment", - "redirect", - "regulation", - "research", - "research_for_development_output", - "residential_property_tribunal_decision", - "role_appointment", - "search", - "service_manual_guide", - "service_manual_homepage", - "service_manual_service_standard", - "service_manual_service_toolkit", - "service_manual_topic", - "service_sign_in", - "service_standard_report", - "services_and_information", - "simple_smart_answer", - "smart_answer", - "social_media_use", - "special_representative_role", - "special_route", - "speech", - "staff_update", - "standard", - "statistical_data_set", - "statistics", - "statistics_announcement", - "statutory_guidance", - "statutory_instrument", - "step_by_step_nav", - "take_part", - "tax_tribunal_decision", - "taxon", - "terms_of_reference", - "topic", - "topical_event", - "topical_event_about_page", - "traffic_commissioner_regulatory_decision", - "traffic_commissioner_role", - "transaction", - "transparency", - "travel_advice", - "travel_advice_index", - "uk_market_conformity_assessment_body", - "utaac_decision", - "vanish", - "welsh_language_scheme", - "working_group", - "world_index", - "world_location", - "world_location_news", - "world_news_story", - "worldwide_office_staff_role", - "worldwide_office", - "worldwide_organisation", - "written_statement" - ] - }, - "first_published_at": { - "$ref": "#/definitions/first_published_at" - }, - "last_edited_at": { - "description": "Last time when the content received a major or minor update.", - "type": "string", - "format": "date-time" - }, - "links": { - "type": "object", - "additionalProperties": false, - "properties": { - "featured_policies": { - "description": "Featured policies primarily for use with Whitehall organisations. Deprecated in favour of ordered_featured_policies.", - "$ref": "#/definitions/guid_list" - }, - "policy_areas": { - "description": "A largely deprecated tag currently only used to power email alerts.", - "$ref": "#/definitions/guid_list" - } - } - }, - "locale": { - "$ref": "#/definitions/locale" - }, - "need_ids": { - "type": "array", - "items": { - "type": "string" - } - }, - "phase": { - "description": "The service design phase of this content item - https://www.gov.uk/service-manual/phases", - "type": "string", - "enum": [ - "alpha", - "beta", - "live" - ] - }, - "previous_version": { - "type": "string" - }, - "public_updated_at": { - "$ref": "#/definitions/public_updated_at" - }, - "publishing_app": { - "$ref": "#/definitions/publishing_app_name" - }, - "redirects": { - "type": "array", - "additionalItems": false, - "items": {} - }, - "rendering_app": { - "$ref": "#/definitions/rendering_app" - }, - "routes": { - "$ref": "#/definitions/routes" - }, - "schema_name": { - "description": "Should be of the form 'placeholder_my_format_name'. 'placeholder' is allowed for backwards compatibility.", - "type": "string", - "pattern": "^(placeholder|placeholder_.+)$" - }, - "title": { - "$ref": "#/definitions/title" - }, - "update_type": { - "$ref": "#/definitions/update_type" - } - }, - "definitions": { - "description": { - "type": "string" - }, - "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})*)*)?$" - }, - "access_limited": { - "type": "object", - "additionalProperties": false, - "properties": { - "auth_bypass_ids": { - "description": "Deprecated: auth_bypass_ids should be sent as a separate field", - "$ref": "#/definitions/guid_list" - }, - "organisations": { - "description": "A list of organisation content ids permitted access to this item", - "$ref": "#/definitions/guid_list" - }, - "users": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "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" - } - ] - }, - "change_note": { - "description": "Change note for the most recent update", - "type": [ - "string", - "null" - ] - }, - "description_optional": { - "anyOf": [ - { - "$ref": "#/definitions/description" - }, - { - "type": "null" - } - ] - }, - "details": { - "type": "object", - "additionalProperties": false, - "properties": { - "analytics_identifier": { - "$ref": "#/definitions/analytics_identifier" - }, - "brand": { - "description": "Used for organisations, to allow us to publish branding / logo information. Remove when organisations are migrated.", - "type": [ - "string", - "null" - ] - }, - "change_note": { - "$ref": "#/definitions/change_note" - }, - "end_date": { - "description": "Used for topical events, so that related documents can get the date. Remove when topical events are migrated.", - "type": "string", - "format": "date-time" - }, - "external_related_links": { - "$ref": "#/definitions/external_related_links" - }, - "logo": { - "description": "Used for organisations, to allow us to publish branding / logo information. Remove when organisations are migrated.", - "type": "object", - "properties": { - "crest": { - "type": [ - "string", - "null" - ], - "enum": [ - "bis", - "dbt", - "eo", - "hmrc", - "ho", - "mod", - "portcullis", - "single-identity", - "so", - "ukaea", - "wales", - null - ] - }, - "formatted_title": { - "type": "string" - }, - "image": { - "$ref": "#/definitions/image" - } - } - }, - "start_date": { - "description": "Used for topical events, so that related documents can get the date. Remove when topical events are migrated.", - "type": "string", - "format": "date-time" - }, - "tags": { - "$ref": "#/definitions/tags" - } - } - }, - "external_link": { - "type": "object", - "required": [ - "title", - "url" - ], - "additionalProperties": false, - "properties": { - "title": { - "type": "string" - }, - "url": { - "type": "string", - "format": "uri" - } - } - }, - "external_related_links": { - "type": "array", - "items": { - "$ref": "#/definitions/external_link" - } - }, - "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" - }, - "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}$" - }, - "guid_list": { - "type": "array", - "items": { - "$ref": "#/definitions/guid" - }, - "uniqueItems": true - }, - "image": { - "type": "object", - "required": [ - "url" - ], - "additionalProperties": false, - "properties": { - "alt_text": { - "type": "string" - }, - "caption": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "credit": { - "anyOf": [ - { - "type": "string" - }, - { - "type": "null" - } - ] - }, - "high_resolution_url": { - "description": "URL to a high resolution version of the image, for use by third parties such as Twitter, Facebook or Slack. Used by the machine readable metadata component. Don't use this on user-facing web pages, as it might be very large.", - "type": "string", - "format": "uri" - }, - "url": { - "description": "URL to the image. The image should be in a suitable resolution for display on the page.", - "type": "string", - "format": "uri" - } - } - }, - "locale": { - "type": "string", - "enum": [ - "ar", - "az", - "be", - "bg", - "bn", - "cs", - "cy", - "da", - "de", - "dr", - "el", - "en", - "es", - "es-419", - "et", - "fa", - "fi", - "fr", - "gd", - "gu", - "he", - "hi", - "hr", - "hu", - "hy", - "id", - "is", - "it", - "ja", - "ka", - "kk", - "ko", - "lt", - "lv", - "ms", - "mt", - "ne", - "nl", - "no", - "pa", - "pa-pk", - "pl", - "ps", - "pt", - "ro", - "ru", - "si", - "sk", - "sl", - "so", - "sq", - "sr", - "sv", - "sw", - "ta", - "th", - "tk", - "tr", - "uk", - "ur", - "uz", - "vi", - "yi", - "zh", - "zh-hk", - "zh-tw" - ] - }, - "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": [ - "account-api", - "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-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" - ] - }, - "rendering_app": { - "description": "The application that renders this item.", - "type": "string", - "enum": [ - "account-api", - "calculators", - "calendars", - "collections", - "content-store", - "email-alert-frontend", - "email-campaign-frontend", - "feedback", - "finder-frontend", - "frontend", - "government-frontend", - "info-frontend", - "licencefinder", - "performanceplatform-big-screen-view", - "rummager", - "search-api", - "smartanswers", - "spotlight", - "static", - "tariff", - "whitehall-admin", - "whitehall-frontend" - ] - }, - "route": { - "type": "object", - "required": [ - "path", - "type" - ], - "additionalProperties": false, - "properties": { - "path": { - "type": "string" - }, - "type": { - "enum": [ - "prefix", - "exact" - ] - } - } - }, - "routes": { - "type": "array", - "items": { - "$ref": "#/definitions/route" - }, - "minItems": 1 - }, - "tags": { - "description": "Field used by email-alert-api to trigger email alerts for subscriptions to topics (gov.uk/topic) and policies (gov.uk/policies).", - "type": "object", - "additionalProperties": false, - "properties": { - "additional_topics": { - "type": "array", - "items": { - "type": "string" - } - }, - "browse_pages": { - "type": "array", - "items": { - "type": "string" - } - }, - "policies": { - "type": "array", - "items": { - "type": "string" - } - }, - "primary_topic": { - "type": "array", - "items": { - "type": "string" - } - }, - "topics": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "title": { - "type": "string" - }, - "update_type": { - "enum": [ - "major", - "minor", - "republish" - ] - } - } -} diff --git a/content_schemas/examples/placeholder/frontend/placeholder.json b/content_schemas/examples/placeholder/frontend/placeholder.json deleted file mode 100644 index db2adf810d..0000000000 --- a/content_schemas/examples/placeholder/frontend/placeholder.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "base_path": "/some-placeholder", - "content_id": "5c806926-7631-11e4-a3cb-005056011aea", - "title": "Some placeholder", - "locale": "en", - "updated_at": "2015-12-02T10:51:26.334Z", - "public_updated_at": "2011-11-17T00:00:00.000+00:00", - "phase": "live", - "links": { - }, - "description": "A placeholder", - "details": { - }, - "schema_name": "placeholder", - "document_type": "placeholder" -} diff --git a/content_schemas/formats/placeholder.jsonnet b/content_schemas/formats/placeholder.jsonnet deleted file mode 100644 index c56431eb72..0000000000 --- a/content_schemas/formats/placeholder.jsonnet +++ /dev/null @@ -1,74 +0,0 @@ -(import "shared/default_format.jsonnet") + { - definitions: (import "shared/definitions/_whitehall.jsonnet") + { - details: { - type: "object", - additionalProperties: false, - properties: { - analytics_identifier: { - "$ref": "#/definitions/analytics_identifier", - }, - change_note: { - "$ref": "#/definitions/change_note", - }, - start_date: { - type: "string", - format: "date-time", - description: "Used for topical events, so that related documents can get the date. Remove when topical events are migrated.", - }, - end_date: { - type: "string", - format: "date-time", - description: "Used for topical events, so that related documents can get the date. Remove when topical events are migrated.", - }, - brand: { - type: [ - "string", - "null", - ], - description: "Used for organisations, to allow us to publish branding / logo information. Remove when organisations are migrated.", - }, - logo: { - type: "object", - properties: { - formatted_title: { - type: "string", - }, - crest: { - type: [ - "string", - "null", - ], - enum: [ - "bis", - "dbt", - "eo", - "hmrc", - "ho", - "mod", - "portcullis", - "single-identity", - "so", - "ukaea", - "wales", - null, - ], - }, - image: { - "$ref": "#/definitions/image", - }, - }, - description: "Used for organisations, to allow us to publish branding / logo information. Remove when organisations are migrated.", - }, - external_related_links: { - "$ref": "#/definitions/external_related_links", - }, - tags: { - "$ref": "#/definitions/tags", - }, - }, - }, - }, - edition_links: (import "shared/base_edition_links.jsonnet") + { - featured_policies: "Featured policies primarily for use with Whitehall organisations. Deprecated in favour of ordered_featured_policies.", - }, -} diff --git a/lib/expansion_rules.rb b/lib/expansion_rules.rb index 87aa8d0a5d..9ed0ea5616 100644 --- a/lib/expansion_rules.rb +++ b/lib/expansion_rules.rb @@ -164,12 +164,8 @@ def details_fields(*fields) fields: CONTACT_FIELDS }, { document_type: :topical_event, fields: DEFAULT_FIELDS }, - { document_type: :placeholder_topical_event, - fields: DEFAULT_FIELDS }, { document_type: :organisation, fields: ORGANISATION_FIELDS }, - { document_type: :placeholder_organisation, - fields: ORGANISATION_FIELDS }, { document_type: :taxon, fields: TAXON_FIELDS }, { document_type: :need, diff --git a/lib/schema_generator/format.rb b/lib/schema_generator/format.rb index 4f422c1e79..cf75aa2fcd 100644 --- a/lib/schema_generator/format.rb +++ b/lib/schema_generator/format.rb @@ -123,18 +123,10 @@ def content_links end def schema_name_definition - if schema_name == "placeholder" - { - "type" => "string", - "pattern" => "^(placeholder|placeholder_.+)$", - "description" => "Should be of the form 'placeholder_my_format_name'. 'placeholder' is allowed for backwards compatibility.", - } - else - { - "enum" => [schema_name], - "type" => "string", - } - end + { + "enum" => [schema_name], + "type" => "string", + } end def publisher_required diff --git a/spec/integration/message_queue_publishing_spec.rb b/spec/integration/message_queue_publishing_spec.rb index 89ecdbd22f..8b584dcc30 100644 --- a/spec/integration/message_queue_publishing_spec.rb +++ b/spec/integration/message_queue_publishing_spec.rb @@ -27,7 +27,7 @@ def stub_content_store_calls(base_path) def ensure_message_queue_payload_validates_against_notification_schema expect(PublishingAPI.service(:queue_publisher)).to have_received(:send_message) do |payload| errors = JSON::Validator.fully_validate( - GovukSchemas::Schema.find(notification_schema: "placeholder"), + GovukSchemas::Schema.find(notification_schema: "speech"), payload, errors_as_objects: true, ) diff --git a/spec/lib/expansion_rules_spec.rb b/spec/lib/expansion_rules_spec.rb index 4c13b2104b..ae8f837203 100644 --- a/spec/lib/expansion_rules_spec.rb +++ b/spec/lib/expansion_rules_spec.rb @@ -71,8 +71,6 @@ specify { expect(rules.expansion_fields(:mainstream_browse_page)).to eq(default_fields_and_description) } specify { expect(rules.expansion_fields(:need)).to eq(need_fields) } specify { expect(rules.expansion_fields(:organisation)).to eq(organisation_fields) } - specify { expect(rules.expansion_fields(:placeholder_organisation)).to eq(organisation_fields) } - specify { expect(rules.expansion_fields(:placeholder_topical_event)).to eq(default_fields) } specify { expect(rules.expansion_fields(:person, link_type: :people)).to eq(default_fields) } specify { expect(rules.expansion_fields(:person, link_type: :person)).to eq(person_fields) } specify { expect(rules.expansion_fields(:role_appointment)).to eq(role_appointment_fields) } diff --git a/spec/queries/get_content_collection_spec.rb b/spec/queries/get_content_collection_spec.rb index 595f4a23f3..1cc06aa641 100644 --- a/spec/queries/get_content_collection_spec.rb +++ b/spec/queries/get_content_collection_spec.rb @@ -74,26 +74,19 @@ end end - it "returns the editions of the given format, and placeholder_format" do + it "returns the editions of the given format" do create( :draft_edition, base_path: "/a", document_type: "topic", schema_name: "topic", ) - create( - :draft_edition, - base_path: "/b", - document_type: "placeholder_topic", - schema_name: "placeholder_topic", - ) expect(Queries::GetContentCollection.new( document_types: "topic", fields: %w[base_path publication_state], ).call).to match_array([ hash_including("base_path" => "/a", "publication_state" => "draft"), - hash_including("base_path" => "/b", "publication_state" => "draft"), ]) end @@ -401,8 +394,8 @@ :draft_edition, base_path: "/b", details: { baz: :bat }, - document_type: "placeholder_topic", - schema_name: "placeholder_topic", + document_type: "topic", + schema_name: "topic", publishing_app: "publisher", ) end diff --git a/spec/queries/get_linkables.rb b/spec/queries/get_linkables.rb index 7e660d9692..8775e7cdbe 100644 --- a/spec/queries/get_linkables.rb +++ b/spec/queries/get_linkables.rb @@ -68,24 +68,6 @@ end end - context "when there is a an edition with a placeholder of the document_type" do - let!(:editions) do - [ - create(:live_edition, document_type: "contact"), - create(:live_edition, document_type: "placeholder_contact"), - ] - end - let(:edition_content_ids) { editions.map { |e| e.document.content_id } } - - it "returns both linkables" do - expect(linkables.length).to be(2) - end - - it "returns the editions" do - expect(linkables.map(&:content_id)).to match_array(edition_content_ids) - end - end - context "when there is a an edition with a different document_type" do before do create(:live_edition, document_type: "different") diff --git a/spec/support/random_content_helpers.rb b/spec/support/random_content_helpers.rb index 501b298715..cd8e1c878f 100644 --- a/spec/support/random_content_helpers.rb +++ b/spec/support/random_content_helpers.rb @@ -2,7 +2,7 @@ module RandomContentHelpers def generate_random_edition(base_path) - GovukSchemas::RandomExample.for_schema(publisher_schema: "placeholder") do |content| + GovukSchemas::RandomExample.for_schema(publisher_schema: "speech") do |content| content.merge( base_path:, update_type: "major",