From 1ad71d5478612a929d894b708399c7b98a8d5780 Mon Sep 17 00:00:00 2001 From: Laura Ghiorghisor Date: Tue, 17 Feb 2026 13:58:01 +0000 Subject: [PATCH] Expand news articles schema to allow `details.images` This is to make the payload consistent with the latest payload for non-embeddable images, such as config-driven topical events' header and logo images. The single `image` property will be removed once we republish all the news articles. --- .../formats/news_article/frontend/schema.json | 60 +++++++++++++++++++ .../news_article/notification/schema.json | 60 +++++++++++++++++++ .../news_article/publisher_v2/schema.json | 60 +++++++++++++++++++ content_schemas/formats/news_article.jsonnet | 6 ++ 4 files changed, 186 insertions(+) diff --git a/content_schemas/dist/formats/news_article/frontend/schema.json b/content_schemas/dist/formats/news_article/frontend/schema.json index 154e4b6e97..a698fb3db1 100644 --- a/content_schemas/dist/formats/news_article/frontend/schema.json +++ b/content_schemas/dist/formats/news_article/frontend/schema.json @@ -328,6 +328,12 @@ "image": { "$ref": "#/definitions/image" }, + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/image_asset" + } + }, "political": { "$ref": "#/definitions/political" }, @@ -629,6 +635,60 @@ } } }, + "image_asset": { + "type": "object", + "required": [ + "content_type", + "sources" + ], + "additionalProperties": false, + "properties": { + "alt_text": { + "type": "string" + }, + "caption": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "content_type": { + "type": "string" + }, + "credit": { + "type": "string" + }, + "sources": { + "type": "object", + "additionalProperties": true, + "patternProperties": { + "^desktop": { + "type": "string", + "format": "uri" + }, + "^mobile": { + "type": "string", + "format": "uri" + }, + "^s[0-9]+": { + "type": "string", + "format": "uri" + }, + "^tablet": { + "type": "string", + "format": "uri" + } + } + }, + "type": { + "type": "string" + } + } + }, "locale": { "type": "string", "enum": [ diff --git a/content_schemas/dist/formats/news_article/notification/schema.json b/content_schemas/dist/formats/news_article/notification/schema.json index eeb9419594..651f62de95 100644 --- a/content_schemas/dist/formats/news_article/notification/schema.json +++ b/content_schemas/dist/formats/news_article/notification/schema.json @@ -434,6 +434,12 @@ "image": { "$ref": "#/definitions/image" }, + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/image_asset" + } + }, "political": { "$ref": "#/definitions/political" }, @@ -748,6 +754,60 @@ } } }, + "image_asset": { + "type": "object", + "required": [ + "content_type", + "sources" + ], + "additionalProperties": false, + "properties": { + "alt_text": { + "type": "string" + }, + "caption": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "content_type": { + "type": "string" + }, + "credit": { + "type": "string" + }, + "sources": { + "type": "object", + "additionalProperties": true, + "patternProperties": { + "^desktop": { + "type": "string", + "format": "uri" + }, + "^mobile": { + "type": "string", + "format": "uri" + }, + "^s[0-9]+": { + "type": "string", + "format": "uri" + }, + "^tablet": { + "type": "string", + "format": "uri" + } + } + }, + "type": { + "type": "string" + } + } + }, "locale": { "type": "string", "enum": [ diff --git a/content_schemas/dist/formats/news_article/publisher_v2/schema.json b/content_schemas/dist/formats/news_article/publisher_v2/schema.json index 7f31962895..b09814d8d7 100644 --- a/content_schemas/dist/formats/news_article/publisher_v2/schema.json +++ b/content_schemas/dist/formats/news_article/publisher_v2/schema.json @@ -275,6 +275,12 @@ "image": { "$ref": "#/definitions/image" }, + "images": { + "type": "array", + "items": { + "$ref": "#/definitions/image_asset" + } + }, "political": { "$ref": "#/definitions/political" }, @@ -450,6 +456,60 @@ } } }, + "image_asset": { + "type": "object", + "required": [ + "content_type", + "sources" + ], + "additionalProperties": false, + "properties": { + "alt_text": { + "type": "string" + }, + "caption": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ] + }, + "content_type": { + "type": "string" + }, + "credit": { + "type": "string" + }, + "sources": { + "type": "object", + "additionalProperties": true, + "patternProperties": { + "^desktop": { + "type": "string", + "format": "uri" + }, + "^mobile": { + "type": "string", + "format": "uri" + }, + "^s[0-9]+": { + "type": "string", + "format": "uri" + }, + "^tablet": { + "type": "string", + "format": "uri" + } + } + }, + "type": { + "type": "string" + } + } + }, "locale": { "type": "string", "enum": [ diff --git a/content_schemas/formats/news_article.jsonnet b/content_schemas/formats/news_article.jsonnet index 868b57f7bb..004a38dd45 100644 --- a/content_schemas/formats/news_article.jsonnet +++ b/content_schemas/formats/news_article.jsonnet @@ -26,6 +26,12 @@ image: { "$ref": "#/definitions/image", }, + images: { + type: "array", + items: { + "$ref": "#/definitions/image_asset", + } + }, first_public_at: { "$ref": "#/definitions/first_public_at", },