Skip to content

Commit 591626c

Browse files
committed
add details to schema script and generate json schema
1 parent f586034 commit 591626c

File tree

2 files changed

+271
-0
lines changed

2 files changed

+271
-0
lines changed

dotcom-rendering/scripts/jsonSchema/schema.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const program = TJS.getProgramFromFiles(
1919
path.resolve(`${root}/src/frontend/feFootballMatchListPage.ts`),
2020
path.resolve(`${root}/src/frontend/feFootballTablesPage.ts`),
2121
path.resolve(`${root}/src/frontend/feFootballMatchPage.ts`),
22+
path.resolve(`${root}/src/frontend/feHostedContent.ts`),
2223
],
2324
{
2425
skipLibCheck: true,
@@ -77,6 +78,10 @@ const schemas = [
7778
typeName: 'FEFootballMatchPage',
7879
file: `${root}/src/frontend/schemas/feFootballMatchPage.json`,
7980
},
81+
{
82+
typeName: 'FEHostedContent',
83+
file: `${root}/src/frontend/schemas/feHostedContent.json`,
84+
},
8085
];
8186

8287
/**
Lines changed: 266 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,266 @@
1+
{
2+
"type": "object",
3+
"properties": {
4+
"id": {
5+
"type": "string"
6+
},
7+
"url": {
8+
"type": "string"
9+
},
10+
"encodedUrl": {
11+
"type": "string"
12+
},
13+
"campaign": {
14+
"type": "object",
15+
"properties": {
16+
"id": {
17+
"type": "string"
18+
},
19+
"name": {
20+
"type": "string"
21+
},
22+
"owner": {
23+
"type": "string"
24+
},
25+
"logo": {
26+
"type": "object",
27+
"properties": {
28+
"src": {
29+
"type": "string"
30+
},
31+
"dimensions": {
32+
"type": "object",
33+
"properties": {
34+
"width": {
35+
"type": "number"
36+
},
37+
"height": {
38+
"type": "number"
39+
}
40+
},
41+
"required": [
42+
"height",
43+
"width"
44+
]
45+
},
46+
"link": {
47+
"type": "string"
48+
}
49+
},
50+
"required": [
51+
"dimensions",
52+
"link",
53+
"src"
54+
]
55+
},
56+
"fontColour": {
57+
"type": "object",
58+
"properties": {
59+
"hexCode": {
60+
"type": "string"
61+
}
62+
},
63+
"required": [
64+
"hexCode"
65+
]
66+
}
67+
},
68+
"required": [
69+
"fontColour",
70+
"id",
71+
"logo",
72+
"name",
73+
"owner"
74+
]
75+
},
76+
"title": {
77+
"type": "string"
78+
},
79+
"mainImageUrl": {
80+
"type": "string"
81+
},
82+
"thumbnailUrl": {
83+
"type": "string"
84+
},
85+
"standfirst": {
86+
"type": "string"
87+
},
88+
"cta": {
89+
"type": "object",
90+
"properties": {
91+
"url": {
92+
"type": "string"
93+
},
94+
"image": {
95+
"type": "string"
96+
},
97+
"label": {
98+
"type": "string"
99+
},
100+
"trackingCode": {
101+
"type": "string"
102+
},
103+
"btnText": {
104+
"type": "string"
105+
}
106+
},
107+
"required": [
108+
"url"
109+
]
110+
},
111+
"name": {
112+
"type": "string"
113+
},
114+
"owner": {
115+
"type": "string"
116+
},
117+
"logo": {
118+
"type": "object",
119+
"properties": {
120+
"src": {
121+
"type": "string"
122+
},
123+
"dimensions": {
124+
"type": "object",
125+
"properties": {
126+
"width": {
127+
"type": "number"
128+
},
129+
"height": {
130+
"type": "number"
131+
}
132+
},
133+
"required": [
134+
"height",
135+
"width"
136+
]
137+
},
138+
"link": {
139+
"type": "string"
140+
}
141+
},
142+
"required": [
143+
"dimensions",
144+
"link",
145+
"src"
146+
]
147+
},
148+
"fontColour": {
149+
"type": "object",
150+
"properties": {
151+
"hexCode": {
152+
"type": "string"
153+
}
154+
},
155+
"required": [
156+
"hexCode"
157+
]
158+
},
159+
"body": {
160+
"type": "string"
161+
},
162+
"mainPicture": {
163+
"type": "string"
164+
},
165+
"mainPictureCaption": {
166+
"type": "string"
167+
},
168+
"video": {
169+
"type": "object",
170+
"properties": {
171+
"mediaId": {
172+
"type": "string"
173+
},
174+
"title": {
175+
"type": "string"
176+
},
177+
"duration": {
178+
"type": "number"
179+
},
180+
"posterUrl": {
181+
"type": "string"
182+
},
183+
"youtubeId": {
184+
"type": "string"
185+
},
186+
"sources": {
187+
"type": "array",
188+
"items": {
189+
"type": "object",
190+
"properties": {
191+
"format": {
192+
"type": "string"
193+
},
194+
"url": {
195+
"type": "string"
196+
},
197+
"rawFormat": {
198+
"type": "string"
199+
}
200+
},
201+
"required": [
202+
"format",
203+
"rawFormat",
204+
"url"
205+
]
206+
}
207+
}
208+
},
209+
"required": [
210+
"duration",
211+
"mediaId",
212+
"posterUrl",
213+
"sources",
214+
"title"
215+
]
216+
},
217+
"images": {
218+
"type": "array",
219+
"items": {
220+
"type": "object",
221+
"properties": {
222+
"url": {
223+
"type": "string"
224+
},
225+
"width": {
226+
"type": "number"
227+
},
228+
"height": {
229+
"type": "number"
230+
},
231+
"title": {
232+
"type": "string"
233+
},
234+
"caption": {
235+
"type": "string"
236+
},
237+
"credit": {
238+
"type": "string"
239+
}
240+
},
241+
"required": [
242+
"caption",
243+
"credit",
244+
"title",
245+
"url"
246+
]
247+
}
248+
}
249+
},
250+
"required": [
251+
"cta",
252+
"encodedUrl",
253+
"fontColour",
254+
"id",
255+
"images",
256+
"logo",
257+
"mainImageUrl",
258+
"name",
259+
"owner",
260+
"standfirst",
261+
"thumbnailUrl",
262+
"title",
263+
"url"
264+
],
265+
"$schema": "http://json-schema.org/draft-07/schema#"
266+
}

0 commit comments

Comments
 (0)