Merge "tests: Remove resources/ from phpunit coverage"
[mediawiki.git] / docs / extension.schema.json
blob45835596988dcb902f84558ee9e82705fc9e1825
2         "$schema": "http://json-schema.org/schema#",
3         "description": "MediaWiki extension.json schema",
4         "type": "object",
5         "properties": {
6                 "name": {
7                         "type": "string",
8                         "description": "The extension's canonical name."
9                 },
10                 "type": {
11                         "type": "string",
12                         "description": "The extension's type, as an index to $wgExtensionCredits.",
13                         "default": "other",
14                         "enum": [
15                                 "api",
16                                 "antispam",
17                                 "datavalues",
18                                 "media",
19                                 "parserhook",
20                                 "semantic",
21                                 "skin",
22                                 "specialpage",
23                                 "variable",
24                                 "other"
25                         ]
26                 },
27                 "author": {
28                         "type": [
29                                 "string",
30                                 "array"
31                         ],
32                         "description": "Extension's authors.",
33                         "items": {
34                                 "type": "string"
35                         },
36                         "additionalItems": false
37                 },
38                 "version": {
39                         "type": "string",
40                         "description": "The version of this release of the extension."
41                 },
42                 "url": {
43                         "type": "string",
44                         "description": "URL to the homepage for the extension.",
45                         "format": "uri"
46                 },
47                 "description": {
48                         "type": "string",
49                         "description": "Raw description of the extension."
50                 },
51                 "descriptionmsg": {
52                         "type": "string",
53                         "description": "Message key for a i18n message describing the extension."
54                 },
55                 "license-name": {
56                         "type": "string",
57                         "description": "Short identifier for the license under which the extension is released.",
58                         "enum": [
59                                 "AFL-1.1",
60                                 "AFL-1.2",
61                                 "AFL-2.0",
62                                 "AFL-2.1",
63                                 "AFL-3.0",
64                                 "APL-1.0",
65                                 "Aladdin",
66                                 "ANTLR-PD",
67                                 "Apache-1.0",
68                                 "Apache-1.1",
69                                 "Apache-2.0",
70                                 "APSL-1.0",
71                                 "APSL-1.1",
72                                 "APSL-1.2",
73                                 "APSL-2.0",
74                                 "Artistic-1.0",
75                                 "Artistic-1.0-cl8",
76                                 "Artistic-1.0-Perl",
77                                 "Artistic-2.0",
78                                 "AAL",
79                                 "BitTorrent-1.0",
80                                 "BitTorrent-1.1",
81                                 "BSL-1.0",
82                                 "BSD-2-Clause",
83                                 "BSD-2-Clause-FreeBSD",
84                                 "BSD-2-Clause-NetBSD",
85                                 "BSD-3-Clause",
86                                 "BSD-3-Clause-Clear",
87                                 "BSD-4-Clause",
88                                 "BSD-4-Clause-UC",
89                                 "CECILL-1.0",
90                                 "CECILL-1.1",
91                                 "CECILL-2.0",
92                                 "CECILL-B",
93                                 "CECILL-C",
94                                 "ClArtistic",
95                                 "CNRI-Python",
96                                 "CNRI-Python-GPL-Compatible",
97                                 "CPOL-1.02",
98                                 "CDDL-1.0",
99                                 "CDDL-1.1",
100                                 "CPAL-1.0",
101                                 "CPL-1.0",
102                                 "CATOSL-1.1",
103                                 "Condor-1.1",
104                                 "CC-BY-1.0",
105                                 "CC-BY-2.0",
106                                 "CC-BY-2.5",
107                                 "CC-BY-3.0",
108                                 "CC-BY-ND-1.0",
109                                 "CC-BY-ND-2.0",
110                                 "CC-BY-ND-2.5",
111                                 "CC-BY-ND-3.0",
112                                 "CC-BY-NC-1.0",
113                                 "CC-BY-NC-2.0",
114                                 "CC-BY-NC-2.5",
115                                 "CC-BY-NC-3.0",
116                                 "CC-BY-NC-ND-1.0",
117                                 "CC-BY-NC-ND-2.0",
118                                 "CC-BY-NC-ND-2.5",
119                                 "CC-BY-NC-ND-3.0",
120                                 "CC-BY-NC-SA-1.0",
121                                 "CC-BY-NC-SA-2.0",
122                                 "CC-BY-NC-SA-2.5",
123                                 "CC-BY-NC-SA-3.0",
124                                 "CC-BY-SA-1.0",
125                                 "CC-BY-SA-2.0",
126                                 "CC-BY-SA-2.5",
127                                 "CC-BY-SA-3.0",
128                                 "CC0-1.0",
129                                 "CUA-OPL-1.0",
130                                 "D-FSL-1.0",
131                                 "WTFPL",
132                                 "EPL-1.0",
133                                 "eCos-2.0",
134                                 "ECL-1.0",
135                                 "ECL-2.0",
136                                 "EFL-1.0",
137                                 "EFL-2.0",
138                                 "Entessa",
139                                 "ErlPL-1.1",
140                                 "EUDatagrid",
141                                 "EUPL-1.0",
142                                 "EUPL-1.1",
143                                 "Fair",
144                                 "Frameworx-1.0",
145                                 "FTL",
146                                 "AGPL-1.0",
147                                 "AGPL-3.0",
148                                 "GFDL-1.1",
149                                 "GFDL-1.2",
150                                 "GFDL-1.3",
151                                 "GPL-1.0",
152                                 "GPL-1.0+",
153                                 "GPL-2.0",
154                                 "GPL-2.0+",
155                                 "GPL-2.0-with-autoconf-exception",
156                                 "GPL-2.0-with-bison-exception",
157                                 "GPL-2.0-with-classpath-exception",
158                                 "GPL-2.0-with-font-exception",
159                                 "GPL-2.0-with-GCC-exception",
160                                 "GPL-3.0",
161                                 "GPL-3.0+",
162                                 "GPL-3.0-with-autoconf-exception",
163                                 "GPL-3.0-with-GCC-exception",
164                                 "LGPL-2.1",
165                                 "LGPL-2.1+",
166                                 "LGPL-3.0",
167                                 "LGPL-3.0+",
168                                 "LGPL-2.0",
169                                 "LGPL-2.0+",
170                                 "gSOAP-1.3b",
171                                 "HPND",
172                                 "IBM-pibs",
173                                 "IPL-1.0",
174                                 "Imlib2",
175                                 "IJG",
176                                 "Intel",
177                                 "IPA",
178                                 "ISC",
179                                 "JSON",
180                                 "LPPL-1.3a",
181                                 "LPPL-1.0",
182                                 "LPPL-1.1",
183                                 "LPPL-1.2",
184                                 "LPPL-1.3c",
185                                 "Libpng",
186                                 "LPL-1.02",
187                                 "LPL-1.0",
188                                 "MS-PL",
189                                 "MS-RL",
190                                 "MirOS",
191                                 "MIT",
192                                 "Motosoto",
193                                 "MPL-1.0",
194                                 "MPL-1.1",
195                                 "MPL-2.0",
196                                 "MPL-2.0-no-copyleft-exception",
197                                 "Multics",
198                                 "NASA-1.3",
199                                 "Naumen",
200                                 "NBPL-1.0",
201                                 "NGPL",
202                                 "NOSL",
203                                 "NPL-1.0",
204                                 "NPL-1.1",
205                                 "Nokia",
206                                 "NPOSL-3.0",
207                                 "NTP",
208                                 "OCLC-2.0",
209                                 "ODbL-1.0",
210                                 "PDDL-1.0",
211                                 "OGTSL",
212                                 "OLDAP-2.2.2",
213                                 "OLDAP-1.1",
214                                 "OLDAP-1.2",
215                                 "OLDAP-1.3",
216                                 "OLDAP-1.4",
217                                 "OLDAP-2.0",
218                                 "OLDAP-2.0.1",
219                                 "OLDAP-2.1",
220                                 "OLDAP-2.2",
221                                 "OLDAP-2.2.1",
222                                 "OLDAP-2.3",
223                                 "OLDAP-2.4",
224                                 "OLDAP-2.5",
225                                 "OLDAP-2.6",
226                                 "OLDAP-2.7",
227                                 "OPL-1.0",
228                                 "OSL-1.0",
229                                 "OSL-2.0",
230                                 "OSL-2.1",
231                                 "OSL-3.0",
232                                 "OLDAP-2.8",
233                                 "OpenSSL",
234                                 "PHP-3.0",
235                                 "PHP-3.01",
236                                 "PostgreSQL",
237                                 "Python-2.0",
238                                 "QPL-1.0",
239                                 "RPSL-1.0",
240                                 "RPL-1.1",
241                                 "RPL-1.5",
242                                 "RHeCos-1.1",
243                                 "RSCPL",
244                                 "Ruby",
245                                 "SAX-PD",
246                                 "SGI-B-1.0",
247                                 "SGI-B-1.1",
248                                 "SGI-B-2.0",
249                                 "OFL-1.0",
250                                 "OFL-1.1",
251                                 "SimPL-2.0",
252                                 "Sleepycat",
253                                 "SMLNJ",
254                                 "SugarCRM-1.1.3",
255                                 "SISSL",
256                                 "SISSL-1.2",
257                                 "SPL-1.0",
258                                 "Watcom-1.0",
259                                 "NCSA",
260                                 "VSL-1.0",
261                                 "W3C",
262                                 "WXwindows",
263                                 "Xnet",
264                                 "X11",
265                                 "XFree86-1.1",
266                                 "YPL-1.0",
267                                 "YPL-1.1",
268                                 "Zimbra-1.3",
269                                 "Zlib",
270                                 "ZPL-1.1",
271                                 "ZPL-2.0",
272                                 "ZPL-2.1",
273                                 "Unlicense"
274                         ]
275                 },
276                 "ResourceLoaderModules": {
277                         "type": "object",
278                         "description": "ResourceLoader modules to register",
279                         "additionalProperties": false,
280                         "patternProperties": {
281                                 "^[a-zA-Z0-9\\.]+$": {
282                                         "type": "object",
283                                         "description": "A single ResourceLoader module descriptor",
284                                         "properties": {
285                                                 "localBasePath": {
286                                                         "type": "string",
287                                                         "description": "Base path to prepend to all local paths in $options. Defaults to $IP"
288                                                 },
289                                                 "remoteBasePath": {
290                                                         "type": "string",
291                                                         "description": "Base path to prepend to all remote paths in $options. Defaults to $wgScriptPath"
292                                                 },
293                                                 "remoteExtPath": {
294                                                         "type": "string",
295                                                         "description": "Equivalent of remoteBasePath, but relative to $wgExtensionAssetsPath"
296                                                 },
297                                                 "scripts": {
298                                                         "type": "array",
299                                                         "description": "Scripts to always include (array of file paths)",
300                                                         "items": {
301                                                                 "type": "string"
302                                                         }
303                                                 },
304                                                 "languageScripts": {
305                                                         "type": "object",
306                                                         "description": "Scripts to include in specific language contexts (mapping of language code to file path(s))",
307                                                         "patternProperties": {
308                                                                 "^[a-zA-Z0-9-]{2,}$": {
309                                                                         "type": [
310                                                                                 "string",
311                                                                                 "array"
312                                                                         ],
313                                                                         "items": {
314                                                                                 "type": "string"
315                                                                         }
316                                                                 }
317                                                         }
318                                                 },
319                                                 "skinScripts": {
320                                                         "type": "object",
321                                                         "description": "Scripts to include in specific skin contexts (mapping of skin name to script(s)",
322                                                         "patternProperties": {
323                                                                 ".+": {
324                                                                         "type": [
325                                                                                 "string",
326                                                                                 "array"
327                                                                         ],
328                                                                         "items": {
329                                                                                 "type": "string"
330                                                                         }
331                                                                 }
332                                                         }
333                                                 },
334                                                 "debugScripts": {
335                                                         "type": "array",
336                                                         "description": "Scripts to include in debug contexts",
337                                                         "items": {
338                                                                 "type": "string"
339                                                         }
340                                                 },
341                                                 "loaderScripts": {
342                                                         "type": "array",
343                                                         "description": "Scripts to include in the startup module",
344                                                         "items": {
345                                                                 "type": "string"
346                                                         }
347                                                 },
348                                                 "dependencies": {
349                                                         "type": "array",
350                                                         "description": "Modules which must be loaded before this module",
351                                                         "items": {
352                                                                 "type": "string"
353                                                         }
354                                                 },
355                                                 "styles": {
356                                                         "type": "array",
357                                                         "description": "Styles to always load",
358                                                         "items": {
359                                                                 "type": "string"
360                                                         }
361                                                 },
362                                                 "skinStyles": {
363                                                         "type": "object",
364                                                         "description": "Styles to include in specific skin contexts (mapping of skin name to style(s))",
365                                                         "patternProperties": {
366                                                                 ".+": {
367                                                                         "type": [
368                                                                                 "string",
369                                                                                 "array"
370                                                                         ],
371                                                                         "items": {
372                                                                                 "type": "string"
373                                                                         }
374                                                                 }
375                                                         }
376                                                 },
377                                                 "messages": {
378                                                         "type": "array",
379                                                         "description": "Messages to always load",
380                                                         "items": {
381                                                                 "type": "string"
382                                                         }
383                                                 },
384                                                 "group": {
385                                                         "type": "string",
386                                                         "description": "Group which this module should be loaded together with"
387                                                 },
388                                                 "position": {
389                                                         "type": "string",
390                                                         "description": "Position on the page to load this module at",
391                                                         "enum": [
392                                                                 "bottom",
393                                                                 "top"
394                                                         ]
395                                                 }
396                                         }
397                                 }
398                         }
399                 },
400                 "ResourceLoaderSources": {
401                         "type": "object",
402                         "description": "ResourceLoader sources to register"
403                 },
404                 "ResourceLoaderLESSVars": {
405                         "type": "object",
406                         "description": "ResourceLoader LESS variables"
407                 },
408                 "ResourceLoaderLESSFunctions": {
409                         "type": "object",
410                         "description": "ResourceLoader LESS functions"
411                 },
412                 "ResourceLoaderLESSImportPaths": {
413                         "type": "object",
414                         "description": "ResourceLoader import paths"
415                 },
416                 "ConfigRegistry": {
417                         "type": "object",
418                         "description": "Registry of factory functions to create Config objects"
419                 },
420                 "namespaces": {
421                         "type": "object",
422                         "description": "Method to add extra namespaces",
423                         "properties": {
424                                 "id": {
425                                         "type": "integer"
426                                 },
427                                 "constant": {
428                                         "type": "string"
429                                 },
430                                 "name": {
431                                         "type": "string"
432                                 },
433                                 "gender": {
434                                         "type": "object",
435                                         "properties": {
436                                                 "male": {
437                                                         "type": "string"
438                                                 },
439                                                 "female": {
440                                                         "type": "string"
441                                                 }
442                                         }
443                                 },
444                                 "subpages": {
445                                         "type": "boolean",
446                                         "default": false
447                                 },
448                                 "content": {
449                                         "type": "boolean",
450                                         "default": false
451                                 },
452                                 "defaultcontentmodel": {
453                                         "type": "string"
454                                 }
455                         }
456                 },
457                 "TrackingCategories": {
458                         "type": "array",
459                         "description": "Tracking category message keys"
460                 },
461                 "DefaultUserOptions": {
462                         "type": "object",
463                         "description": "Default values of user options"
464                 },
465                 "HiddenPrefs": {
466                         "type": "array",
467                         "description": "Preferences users cannot set"
468                 },
469                 "GroupPermissions": {
470                         "type": "object",
471                         "description": "Default permissions to give to user groups"
472                 },
473                 "RevokePermissions": {
474                         "type": "object",
475                         "description": "Default permissions to revoke from user groups"
476                 },
477                 "ImplicitGroups": {
478                         "type": "array",
479                         "description": "Implicit groups"
480                 },
481                 "GroupsAddToSelf": {
482                         "type": "object",
483                         "description": "Groups a user can add to themselves"
484                 },
485                 "GroupsRemoveFromSelf": {
486                         "type": "object",
487                         "description": "Groups a user can remove from themselves"
488                 },
489                 "AddGroups": {
490                         "type": "object",
491                         "description": "Groups a user can add to users"
492                 },
493                 "RemoveGroups": {
494                         "type": "object",
495                         "description": "Groups a user can remove from users"
496                 },
497                 "AvailableRights": {
498                         "type": "array",
499                         "description": "User rights added by the extension"
500                 },
501                 "ContentHandlers": {
502                         "type": "object",
503                         "description": "Mapping of model ID to class name"
504                 },
505                 "RateLimits": {
506                         "type": "object",
507                         "description": "Rate limits"
508                 },
509                 "ParserTestFiles": {
510                         "type": "array",
511                         "description": "Parser test files to run"
512                 },
513                 "RecentChangesFlags": {
514                         "type": "object",
515                         "description": "Flags (letter symbols) shown on RecentChanges pages"
516                 },
517                 "ExtensionFunctions": {
518                         "type": [
519                                 "array",
520                                 "string"
521                         ],
522                         "description": "Function to call after setup has finished"
523                 },
524                 "ExtensionMessagesFiles": {
525                         "type": "object",
526                         "description": "File paths containing PHP internationalization data"
527                 },
528                 "MessagesDirs": {
529                         "type": "object",
530                         "description": "Directory paths containing JSON internationalization data"
531                 },
532                 "ExtensionEntryPointListFiles": {
533                         "type": "object"
534                 },
535                 "SpecialPages": {
536                         "type": "object",
537                         "description": "SpecialPages implemented in this extension (mapping of page name to class name)"
538                 },
539                 "SpecialPageGroups": {
540                         "type": "object",
541                         "description": "Mapping of special page name to group it belongs to"
542                 },
543                 "AutoloadClasses": {
544                         "type": "object"
545                 },
546                 "Hooks": {
547                         "type": "object",
548                         "description": "Hooks this extension uses (mapping of hook name to callback)"
549                 },
550                 "JobClasses": {
551                         "type": "object",
552                         "description": "Job types this extension implements (mapping of job type to class name)"
553                 },
554                 "LogTypes": {
555                         "type": "array",
556                         "description": "List of new log types this extension uses"
557                 },
558                 "LogRestrictions": {
559                         "type": "object"
560                 },
561                 "FilterLogTypes": {
562                         "type": "array"
563                 },
564                 "LogNames": {
565                         "type": "object"
566                 },
567                 "LogHeaders": {
568                         "type": "object"
569                 },
570                 "LogActions": {
571                         "type": "object"
572                 },
573                 "LogActionsHandlers": {
574                         "type": "object"
575                 },
576                 "Actions": {
577                         "type": "object"
578                 },
579                 "APIModules": {
580                         "type": "object"
581                 },
582                 "APIFormatModules": {
583                         "type": "object"
584                 },
585                 "APIMetaModules": {
586                         "type": "object"
587                 },
588                 "APIPropModules": {
589                         "type": "object"
590                 },
591                 "APIListModules": {
592                         "type": "object"
593                 },
594                 "callback": {
595                         "type": [
596                                 "array",
597                                 "string"
598                         ],
599                         "description": "A function to be called right after MediaWiki processes this file"
600                 },
601                 "config": {
602                         "type": "object",
603                         "description": "Configuration options for this extension"
604                 }
605         }