Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dotcom-rendering/src/frontend/feTagPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ export type FETagPage = {
forceDay: boolean;
canonicalUrl?: string;
contributionsServiceUrl: string;
storylinesContent?: StorylinesContent;
// This comment is needed to ensure null is recognised properly in the schema
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is deliberately not a JSDoc comment to avoid this appearing in the schema itself

/** @nullable true */
storylinesContent?: StorylinesContent | null;
};
171 changes: 89 additions & 82 deletions dotcom-rendering/src/frontend/schemas/feTagPage.json
Original file line number Diff line number Diff line change
Expand Up @@ -1285,105 +1285,112 @@
"type": "string"
},
"storylinesContent": {
"type": "object",
"properties": {
"created": {
"type": "string"
},
"tag": {
"type": "string"
},
"storylines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"content": {
"type": "array",
"items": {
"type": "object",
"properties": {
"category": {
"type": "string"
},
"articles": {
"type": "array",
"items": {
"type": "object",
"properties": {
"url": {
"type": "string"
},
"headline": {
"type": "string"
},
"byline": {
"type": "string"
},
"publicationTime": {
"type": "string"
},
"image": {
"anyOf": [
{
"type": "object",
"properties": {
"created": {
"type": "string"
},
"tag": {
"type": "string"
},
"storylines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": {
"type": "string"
},
"content": {
"type": "array",
"items": {
"type": "object",
"properties": {
"category": {
"type": "string"
},
"articles": {
"type": "array",
"items": {
"type": "object",
"properties": {
"src": {
"url": {
"type": "string"
},
"headline": {
"type": "string"
},
"altText": {
"byline": {
"type": "string"
},
"isAvatar": {
"type": "boolean"
"publicationTime": {
"type": "string"
},
"mediaData": {
"$ref": "#/definitions/MainMedia"
"image": {
"type": "object",
"properties": {
"src": {
"type": "string"
},
"altText": {
"type": "string"
},
"isAvatar": {
"type": "boolean"
},
"mediaData": {
"$ref": "#/definitions/MainMedia"
}
},
"required": [
"altText",
"isAvatar",
"src"
]
}
},
"required": [
"altText",
"isAvatar",
"src"
"headline",
"publicationTime",
"url"
]
}
},
"required": [
"headline",
"publicationTime",
"url"
]
}
}
},
"required": [
"articles",
"category"
]
}
},
"required": [
"articles",
"category"
]
}
}
},
"required": [
"content",
"title"
]
}
},
"required": [
"content",
"title"
]
}
},
"articleCount": {
"type": "number"
},
"earliestArticleTime": {
"type": "string"
"articleCount": {
"type": "number"
},
"earliestArticleTime": {
"type": "string"
},
"latestArticleTime": {
"type": "string"
}
},
"required": [
"created",
"storylines",
"tag"
]
},
"latestArticleTime": {
"type": "string"
{
"type": "null"
}
},
"required": [
"created",
"storylines",
"tag"
]
}
},
Expand Down
1 change: 1 addition & 0 deletions dotcom-rendering/src/server/handler.front.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ const enhanceTagPage = (body: unknown): TagPage => {
},
branding: tagPageBranding,
canonicalUrl: data.canonicalUrl,
storylinesContent: data.storylinesContent ?? undefined,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use nullish coalescing operator to convert to undefined for rest of DCR to use if null

};
};

Expand Down
24 changes: 12 additions & 12 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading