First version of JSON schema for game data.
[ouya-game-data.git] / schema.json
1 {
2     "$schema": "http://json-schema.org/draft-07/schema#",
3     "$id": "http://example.com/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         "package",
10         "title",
11         "releases",
12         "media",
13         "developer"
14     ],
15     "additionalProperties": false,    
16     "properties": {
17         "package": {
18             "description": "Java package name",
19             "type": "string"
20         },
21         
22         "title": {
23             "description": "Game name",
24             "type": "string"
25         },
26         
27         "description": {
28             "description": "Text describing the game. Newlines (CRLF) allowed",
29             "type": "string"
30         },
31         
32         "players": {
33             "description": "How many players can play this game at the same time?",
34             "type": "array",
35             "items": {
36                 "type": "number",
37                 "minimum": 1
38             }
39         },
40         
41         "genres": {
42             "description": "Categories",
43             "type": "array",
44             "items": {
45                 "type": "string",
46                 "uniqueItems": true,
47                 "enum": [
48                     "Adventure",
49                     "App",
50                     "Arcade/Pinball",
51                     "Card/Casino",
52                     "Dual Stick",
53                     "Entertainment",
54                     "Fight!",
55                     "FPS/Shooter",
56                     "Kids List",
57                     "Meditative",
58                     "Multiplayer",
59                     "Music",
60                     "Platformer",
61                     "Puzzle/Trivia",
62                     "Racing",
63                     "Retro",
64                     "Role-Playing",
65                     "Short on Time?",
66                     "Sim/Strategy",
67                     "Sports",
68                     "Utility",
69                     "Video"
70                 ]
71             }
72         },
73
74         "releases": {
75             "type": "array",
76             "items": {
77                 "type": "object",
78                 "required": [
79                     "name",
80                     "versionCode",
81                     "uuid",
82                     "date",
83                     "url",
84                     "size",
85                     "md5sum"
86                 ],
87                 "additionalProperties": false,
88                 "properties": {
89                 
90                     "name": {
91                         "description": "Human readable version number ('1.6')",
92                         "type": "string"
93                     },
94
95                     "versionCode": {
96                         "description": "APK-internal version code. Run \"aapt dump badging file.apk\", field \"versionCode\"",
97                         "type": "string"
98                     },
99
100                     "uuid": {
101                         "description": "Unique ID for the release. Use uuid-gen to get one",
102                         "type": "string"
103                     },
104
105                     "date": {
106                         "description": "When the version has been released",
107                         "type": "string",
108                         "format": "date"
109                     },
110
111                     "latest": {
112                         "description": "Marker for the latest release",
113                         "type": "boolean"
114                     },
115
116                     "url": {
117                         "description": ".apk download link",
118                         "type": "string",
119                         "format": "url"
120                     },
121
122                     "size": {
123                         "description": "File size in bytes",
124                         "type": "number",
125                         "minimum": 1
126                     },
127
128                     "md5sum": {
129                         "description": "MD5 hash of the .apk file contents",
130                         "type": "string"
131                     },
132
133                     "publicSize": {
134                         "description": "FIXME",
135                         "type": "number"
136                     },
137
138                     "nativeSize": {
139                         "description": "FIXME",
140                         "type": "number"
141                     }
142                 }
143             }
144         },
145
146         "media": {
147             "type": "object",
148             "FIXME": ""
149         },
150
151         "developer": {
152             "type": "object",
153             "required": [
154                 "name"
155             ],
156             "additionalProperties": false,
157             "properties": {
158                 
159                 "uuid": {
160                     "description": "Unique ID for the developer",
161                     "type": "string"
162                 },
163                 
164                 "name": {
165                     "description": "Developer (company or person) name",
166                     "type": "string"
167                 },
168                 
169                 "supportEmail": {
170                     "description": "E-Mail address for support questions",
171                     "type": "string",
172                     "format": "email"
173                 },
174                 
175                 "supportPhone": {
176                     "description": "Telephone number",
177                     "type": "string"
178                 },
179                 
180                 "founder": {
181                     "description": "If the developer was an OUYA founder",
182                     "type": "boolean"
183                 }
184             }
185         },
186
187         "contentRating": {
188             "description": "Which audience is this game for?",
189             "type": "string",
190             "enum": [
191                 "Everyone",
192                 "9+",
193                 "12+",
194                 "17+"
195             ]
196         },
197
198         "website": {
199             "description": "Game website",
200             "type": "string",
201             "format": "url"
202         },
203
204         "firstPublishedAt": {
205             "description": "When the game has first been published to the world",
206             "type": "string",
207             "format": "date|date-time"
208         },
209
210         "inAppPurchases": {
211             "description": "If you can buy things in the game",
212             "type": "boolean"
213         },
214
215         "overview": {
216             "description": "FIXME",
217             "type": "string"
218         },
219
220         "premium": {
221             "description": "FIXME",
222             "type": "boolean"
223         },
224
225         "rating": {
226             "type": "object",
227             "additionalProperties": false,
228             "properties": {
229                 
230                 "likeCount": {
231                     "description": "Number of likes this game has",
232                     "type": "number",
233                     "minimum": 0
234                 },
235                 
236                 "average": {
237                     "description": "Average rating for this game (0-5)",
238                     "type": "number",
239                     "minimum": 0
240                 },
241                 
242                 "count": {
243                     "description": "Number of ratings",
244                     "type": "number",
245                     "minimum": 0
246                 }
247             }
248         },
249
250         "products": {
251             "type": "array",
252             "items": {
253                 "FIXME": ""
254             }
255         }
256     }
257 }