7ea380a1058c8621a34592a19a3e2293495c189c
[ouya-game-data.git] / 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",
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",
244                     "format": "email"
245                 },
246
247                 "supportPhone": {
248                     "description": "Telephone number",
249                     "type": "string"
250                 },
251
252                 "founder": {
253                     "description": "If the developer was an OUYA founder",
254                     "type": "boolean"
255                 }
256             }
257         },
258
259         "contentRating": {
260             "description": "Which audience is this game for?",
261             "type": "string",
262             "enum": [
263                 "Everyone",
264                 "9+",
265                 "12+",
266                 "17+"
267             ]
268         },
269
270         "website": {
271             "description": "Game website",
272             "type": "string",
273             "format": "url"
274         },
275
276         "firstPublishedAt": {
277             "description": "When the game has first been published to the world",
278             "type": "string",
279             "format": "date|date-time"
280         },
281
282         "inAppPurchases": {
283             "description": "If you can buy things in the game",
284             "type": "boolean"
285         },
286
287         "overview": {
288             "description": "FIXME",
289             "type": "string"
290         },
291
292         "premium": {
293             "description": "FIXME",
294             "type": "boolean"
295         },
296
297         "rating": {
298             "type": "object",
299             "additionalProperties": false,
300             "properties": {
301
302                 "likeCount": {
303                     "description": "Number of likes this game has",
304                     "type": "number",
305                     "minimum": 0
306                 },
307
308                 "average": {
309                     "description": "Average rating for this game",
310                     "type": "number",
311                     "minimum": 0,
312                     "maximum": 5
313                 },
314
315                 "count": {
316                     "description": "Number of ratings",
317                     "type": "number",
318                     "minimum": 0
319                 }
320             }
321         },
322
323         "products": {
324             "description": "Items that could be bought via the discover store",
325             "type": "array",
326             "items": {
327                 "type": "object",
328                 "required": [
329                     "identifier",
330                     "name",
331                     "description",
332                     "localPrice",
333                     "originalPrice",
334                     "currency"
335                 ],
336                 "additionalProperties": false,
337                 "properties": {
338
339                     "promoted": {
340                         "description": "If this product is the currently promoted/visible one",
341                         "type": "boolean"
342                     },
343
344                     "identifier": {
345                         "description": "Internal key",
346                         "type": "string",
347                         "examples": [
348                             "full_version"
349                         ]
350                     },
351
352                     "name": {
353                         "description": "Human readable name",
354                         "type": "string",
355                         "examples": [
356                             "Unlock full game"
357                         ]
358                     },
359
360                     "description": {
361                         "description": "Explanation of the features you will buy",
362                         "type": "string"
363                     },
364
365                     "localPrice": {
366                         "description": "Current price (maybe discounted)",
367                         "type": "number"
368                     },
369
370                     "originalPrice": {
371                         "description": "Previous price",
372                         "type": "number"
373                     },
374
375                     "currency": {
376                         "description": "Three-letter currency code, depending on the player that was logged in",
377                         "type": "string",
378                         "enum": ["EUR", "USD"]
379                     }
380                 }
381             }
382         }
383     }
384 }