Make more fields nullable
[ouya-game-data.git] / ouya-game.schema.json
1 {
2     "$schema": "http://json-schema.org/draft-07/schema#",
3     "$id": "http://cweiske.de/ouya-game.schema.json",
4     "title": "OUYA game metadata",
5     "description": "Game data importable in OUYA API servers.",
6     "type": "object",
7
8     "required": [
9         "packageName",
10         "title",
11         "releases",
12         "media",
13         "developer"
14     ],
15     "additionalProperties": false,
16     "properties": {
17         "packageName": {
18             "description": "Java package names",
19             "type": "string",
20             "examples": [
21                 "com.vendor.gamename"
22             ]
23         },
24
25         "title": {
26             "description": "Game name",
27             "type": "string"
28         },
29
30         "description": {
31             "description": "Text describing the game. Newlines (CRLF) allowed",
32             "type": "string"
33         },
34
35         "players": {
36             "description": "How many players can play this game at the same time?",
37             "type": "array",
38             "items": {
39                 "type": "number",
40                 "minimum": 1
41             }
42         },
43
44         "genres": {
45             "description": "Categories",
46             "type": "array",
47             "items": {
48                 "type": "string",
49                 "uniqueItems": true,
50                 "enum": [
51                     "Adventure",
52                     "App",
53                     "Arcade/Pinball",
54                     "Card/Casino",
55                     "Dual Stick",
56                     "Entertainment",
57                     "Fight!",
58                     "FPS/Shooter",
59                     "Kids List",
60                     "Meditative",
61                     "Multiplayer",
62                     "Music",
63                     "Platformer",
64                     "Puzzle/Trivia",
65                     "Racing",
66                     "Retro",
67                     "Role-Playing",
68                     "Short on Time?",
69                     "Sim/Strategy",
70                     "Sports",
71                     "Utility",
72                     "Video",
73
74                     "Open Source"
75                 ]
76             }
77         },
78
79         "releases": {
80             "type": "array",
81             "items": {
82                 "type": "object",
83                 "required": [
84                     "name",
85                     "versionCode",
86                     "uuid",
87                     "date",
88                     "url",
89                     "size",
90                     "md5sum"
91                 ],
92                 "additionalProperties": false,
93                 "properties": {
94
95                     "name": {
96                         "description": "Human readable version number",
97                         "type": "string",
98                         "examples": [
99                             "1.6"
100                         ]
101                     },
102
103                     "versionCode": {
104                         "description": "APK-internal version code. Run \"aapt dump badging file.apk\", field \"versionCode\"",
105                         "type": ["string", "null"]
106                     },
107
108                     "uuid": {
109                         "description": "Unique ID for the release. Use uuid-gen to get one",
110                         "type": "string"
111                     },
112
113                     "date": {
114                         "description": "When the version has been released",
115                         "type": "string",
116                         "format": "date|datetime"
117                     },
118
119                     "latest": {
120                         "description": "Marker for the latest release",
121                         "type": "boolean"
122                     },
123
124                     "url": {
125                         "description": ".apk download link",
126                         "type": "string",
127                         "format": "url"
128                     },
129
130                     "size": {
131                         "description": "File size in bytes",
132                         "type": "number",
133                         "minimum": 1
134                     },
135
136                     "md5sum": {
137                         "description": "MD5 hash of the .apk file contents",
138                         "type": "string"
139                     },
140
141                     "publicSize": {
142                         "description": "FIXME",
143                         "type": "number"
144                     },
145
146                     "nativeSize": {
147                         "description": "FIXME",
148                         "type": "number"
149                     }
150                 }
151             }
152         },
153
154         "media": {
155             "type": "object",
156             "required": [
157                 "discover",
158                 "large"
159             ],
160             "additionalProperties": false,
161             "properties": {
162                 "discover": {
163                     "description": "Image for the OUYA discover store. FIXME: Size",
164                     "type": "string",
165                     "format": "url"
166                 },
167
168                 "large": {
169                     "description": "Large game cover image for the store details page.",
170                     "type": "string",
171                     "format": "url"
172                 },
173
174                 "video": {
175                     "description": "Video for the store details page. Vimeo and Youtube URLs supported",
176                     "type": "string",
177                     "format": "url"
178                 },
179
180                 "screenshots": {
181                     "description": "Additional images for the store details page.",
182                     "type": "array",
183                     "items": {
184                         "type": "string",
185                         "format": "url"
186                     }
187                 },
188
189                 "details": {
190                     "description": "Images and videos for the details page. Can be in any order. If no detail images and videos are given, the large image, video and screenshots are used instead",
191                     "type": "array",
192                     "items": {
193                         "type": "object",
194                         "required": [
195                             "type",
196                             "url"
197                         ],
198                         "additionalProperties": false,
199                         "properties": {
200                             "type": {
201                                 "description": "Medium type: image or video",
202                                 "type": "string",
203                                 "enum": ["image", "video"]
204                             },
205
206                             "url": {
207                                 "description": "Image URL or video URL. Vimeo and Youtube URLs supported",
208                                 "type": "string",
209                                 "format": "url"
210                             },
211
212                             "thumb": {
213                                 "description": "Small preview image. Size should be 852x479.",
214                                 "type": "string",
215                                 "format": "url"
216                             }
217                         }
218                     }
219                 }
220             }
221         },
222
223         "developer": {
224             "type": "object",
225             "required": [
226                 "name"
227             ],
228             "additionalProperties": false,
229             "properties": {
230
231                 "uuid": {
232                     "description": "Unique ID for the developer",
233                     "type": "string"
234                 },
235
236                 "name": {
237                     "description": "Developer (company or person) name",
238                     "type": "string"
239                 },
240
241                 "supportEmail": {
242                     "description": "E-Mail address for support questions",
243                     "type": ["string", "null"],
244                     "format": "email",
245                     "default": null
246                 },
247
248                 "supportPhone": {
249                     "description": "Telephone number",
250                     "type": ["string", "null"],
251                     "default": null
252                 },
253
254                 "founder": {
255                     "description": "If the developer was an OUYA founder",
256                     "type": "boolean",
257                     "default": false
258                 }
259             }
260         },
261
262         "contentRating": {
263             "description": "Which audience is this game for?",
264             "type": "string",
265             "enum": [
266                 "Everyone",
267                 "9+",
268                 "12+",
269                 "17+"
270             ]
271         },
272
273         "website": {
274             "description": "Game website",
275             "type": ["string", "null"],
276             "format": "url"
277         },
278
279         "firstPublishedAt": {
280             "description": "When the game has first been published to the world",
281             "type": ["string", "null"],
282             "format": "date|date-time",
283             "default": null
284         },
285
286         "inAppPurchases": {
287             "description": "If you can buy things in the game",
288             "type": "boolean",
289             "default": false
290         },
291
292         "overview": {
293             "description": "FIXME",
294             "type": ["string", "null"],
295             "default": null
296         },
297
298         "premium": {
299             "description": "FIXME",
300             "type": "boolean",
301             "default": false
302         },
303
304         "rating": {
305             "type": "object",
306             "additionalProperties": false,
307             "properties": {
308
309                 "likeCount": {
310                     "description": "Number of likes this game has",
311                     "type": "number",
312                     "minimum": 0,
313                     "default": 0
314                 },
315
316                 "average": {
317                     "description": "Average rating for this game",
318                     "type": "number",
319                     "minimum": 0,
320                     "maximum": 5,
321                     "default": 0
322                 },
323
324                 "count": {
325                     "description": "Number of ratings",
326                     "type": "number",
327                     "minimum": 0,
328                     "default": 0
329                 }
330             }
331         },
332
333         "products": {
334             "description": "Items that could be bought via the discover store",
335             "type": "array",
336             "items": {
337                 "type": "object",
338                 "required": [
339                     "identifier",
340                     "name",
341                     "description",
342                     "localPrice",
343                     "originalPrice",
344                     "currency"
345                 ],
346                 "additionalProperties": false,
347                 "properties": {
348
349                     "promoted": {
350                         "description": "If this product is the currently promoted/visible one",
351                         "type": "boolean"
352                     },
353
354                     "identifier": {
355                         "description": "Internal key",
356                         "type": "string",
357                         "examples": [
358                             "full_version"
359                         ]
360                     },
361
362                     "name": {
363                         "description": "Human readable name",
364                         "type": "string",
365                         "examples": [
366                             "Unlock full game"
367                         ]
368                     },
369
370                     "description": {
371                         "description": "Explanation of the features you will buy",
372                         "type": "string"
373                     },
374
375                     "localPrice": {
376                         "description": "Current price (maybe discounted)",
377                         "type": "number"
378                     },
379
380                     "originalPrice": {
381                         "description": "Previous price",
382                         "type": "number"
383                     },
384
385                     "currency": {
386                         "description": "Three-letter currency code, depending on the player that was logged in",
387                         "type": "string",
388                         "enum": ["EUR", "USD"]
389                     }
390                 }
391             }
392         }
393     }
394 }