Remove dire config-dbsupport-postgres warning
[mediawiki.git] / docs / extension.schema.json
blob84a404a2e2dddde9cb9cac12135cf5aa3958e792
2         "$schema": "http://json-schema.org/schema#",
3         "description": "MediaWiki extension.json schema",
4         "type": "object",
5         "properties": {
6                 "manifest_version": {
7                         "type": "integer",
8                         "description": "Version of the extension.json schema the extension.json file is in.",
9                         "required": true
10                 },
11                 "name": {
12                         "type": "string",
13                         "description": "The extension's canonical name.",
14                         "required": true
15                 },
16                 "namemsg": {
17                         "type": "string",
18                         "description": "i18n message key of the extension's name."
19                 },
20                 "type": {
21                         "type": "string",
22                         "description": "The extension's type, as an index to $wgExtensionCredits.",
23                         "default": "other"
24                 },
25                 "author": {
26                         "type": [
27                                 "string",
28                                 "array"
29                         ],
30                         "description": "Extension's authors.",
31                         "items": {
32                                 "type": "string"
33                         }
34                 },
35                 "version": {
36                         "type": "string",
37                         "description": "The version of this release of the extension."
38                 },
39                 "url": {
40                         "type": "string",
41                         "description": "URL to the homepage for the extension.",
42                         "format": "uri"
43                 },
44                 "description": {
45                         "type": "string",
46                         "description": "Raw description of the extension."
47                 },
48                 "descriptionmsg": {
49                         "type": "string",
50                         "description": "Message key for a i18n message describing the extension."
51                 },
52                 "license-name": {
53                         "type": "string",
54                         "description": "SPDX identifier for the license under which the extension is released."
55                 },
56                 "requires": {
57                         "type": "object",
58                         "description": "Indicates what versions of MediaWiki core are required. This syntax may be extended in the future, for example to check dependencies between other extensions.",
59                         "properties": {
60                                 "MediaWiki": {
61                                         "type": "string",
62                                         "description": "Version constraint string against MediaWiki core."
63                                 }
64                         }
65                 },
66                 "ResourceFileModulePaths": {
67                         "type": "object",
68                         "description": "Default paths to use for all ResourceLoader file modules",
69                         "additionalProperties": false,
70                         "properties": {
71                                 "localBasePath": {
72                                         "type": "string",
73                                         "description": "Base path to prepend to all local paths, relative to current directory"
74                                 },
75                                 "remoteExtPath": {
76                                         "type": "string",
77                                         "description": "Base path to prepend to all remote paths, relative to $wgExtensionAssetsPath"
78                                 },
79                                 "remoteSkinPath": {
80                                         "type": "string",
81                                         "description": "Base path to prepend to all remote paths, relative to $wgStylePath"
82                                 }
83                         }
84                 },
85                 "ResourceModules": {
86                         "type": "object",
87                         "description": "ResourceLoader modules to register",
88                         "patternProperties": {
89                                 "^[a-zA-Z0-9-\\.]+$": {
90                                         "type": "object",
91                                         "anyOf": [
92                                                 {
93                                                         "description": "A ResourceLoaderFileModule definition",
94                                                         "additionalProperties": false,
95                                                         "properties": {
96                                                                 "localBasePath": {
97                                                                         "type": "string",
98                                                                         "description": "Base path to prepend to all local paths in $options. Defaults to $IP"
99                                                                 },
100                                                                 "remoteBasePath": {
101                                                                         "type": "string",
102                                                                         "description": "Base path to prepend to all remote paths in $options. Defaults to $wgScriptPath"
103                                                                 },
104                                                                 "remoteExtPath": {
105                                                                         "type": "string",
106                                                                         "description": "Equivalent of remoteBasePath, but relative to $wgExtensionAssetsPath"
107                                                                 },
108                                                                 "skipFunction": {
109                                                                         "type": "string",
110                                                                         "description": "Path to a file containing a JavaScript \"skip function\", if desired."
111                                                                 },
112                                                                 "scripts": {
113                                                                         "type": ["string", "array"],
114                                                                         "description": "Scripts to always include (array of file paths)",
115                                                                         "items": {
116                                                                                 "type": "string"
117                                                                         }
118                                                                 },
119                                                                 "languageScripts": {
120                                                                         "type": "object",
121                                                                         "description": "Scripts to include in specific language contexts (mapping of language code to file path(s))",
122                                                                         "patternProperties": {
123                                                                                 "^[a-zA-Z0-9-]{2,}$": {
124                                                                                         "type": [
125                                                                                                 "string",
126                                                                                                 "array"
127                                                                                         ],
128                                                                                         "items": {
129                                                                                                 "type": "string"
130                                                                                         }
131                                                                                 }
132                                                                         }
133                                                                 },
134                                                                 "skinScripts": {
135                                                                         "type": "object",
136                                                                         "description": "Scripts to include in specific skin contexts (mapping of skin name to script(s)",
137                                                                         "patternProperties": {
138                                                                                 ".+": {
139                                                                                         "type": [
140                                                                                                 "string",
141                                                                                                 "array"
142                                                                                         ],
143                                                                                         "items": {
144                                                                                                 "type": "string"
145                                                                                         }
146                                                                                 }
147                                                                         }
148                                                                 },
149                                                                 "debugScripts": {
150                                                                         "type": ["string", "array"],
151                                                                         "description": "Scripts to include in debug contexts",
152                                                                         "items": {
153                                                                                 "type": "string"
154                                                                         }
155                                                                 },
156                                                                 "loaderScripts": {
157                                                                         "type": ["string", "array"],
158                                                                         "description": "Scripts to include in the startup module",
159                                                                         "items": {
160                                                                                 "type": "string"
161                                                                         }
162                                                                 },
163                                                                 "dependencies": {
164                                                                         "type": ["string", "array"],
165                                                                         "description": "Modules which must be loaded before this module",
166                                                                         "items": {
167                                                                                 "type": "string"
168                                                                         }
169                                                                 },
170                                                                 "styles": {
171                                                                         "type": ["string", "array", "object"],
172                                                                         "description": "Styles to always load",
173                                                                         "items": {
174                                                                                 "type": "string"
175                                                                         }
176                                                                 },
177                                                                 "skinStyles": {
178                                                                         "type": "object",
179                                                                         "description": "Styles to include in specific skin contexts (mapping of skin name to style(s))",
180                                                                         "patternProperties": {
181                                                                                 ".+": {
182                                                                                         "type": [
183                                                                                                 "string",
184                                                                                                 "array"
185                                                                                         ],
186                                                                                         "items": {
187                                                                                                 "type": "string"
188                                                                                         }
189                                                                                 }
190                                                                         }
191                                                                 },
192                                                                 "messages": {
193                                                                         "type": ["string", "array"],
194                                                                         "description": "Messages to always load",
195                                                                         "items": {
196                                                                                 "type": "string"
197                                                                         }
198                                                                 },
199                                                                 "group": {
200                                                                         "type": "string",
201                                                                         "description": "Group with which this module should be loaded"
202                                                                 },
203                                                                 "deprecated": {
204                                                                         "type": ["object", "boolean"],
205                                                                         "description": "Whether the module is deprecated and usage is discouraged. Either a boolean or an object with key message can be used to customise deprecation message."
206                                                                 },
207                                                                 "position": {
208                                                                         "type": "string",
209                                                                         "description": "Position on the page to load this module at",
210                                                                         "enum": [
211                                                                                 "bottom",
212                                                                                 "top"
213                                                                         ]
214                                                                 },
215                                                                 "templates": {
216                                                                         "type": ["object", "array"],
217                                                                         "description": "Templates to be loaded for client-side usage"
218                                                                 },
219                                                                 "targets": {
220                                                                         "type": ["string", "array"],
221                                                                         "description": "ResourceLoader target the module can run on",
222                                                                         "items": {
223                                                                                 "type": "string"
224                                                                         }
225                                                                 }
226                                                         }
227                                                 },
228                                                 {
229                                                         "description": "A ResourceLoaderWikiModule definition",
230                                                         "additionalProperties": false,
231                                                         "properties": {
232                                                                 "class": {
233                                                                         "enum": ["ResourceLoaderWikiModule"]
234                                                                 },
235                                                                 "group": {
236                                                                         "type": "string",
237                                                                         "description": "Group with which this module should be loaded"
238                                                                 },
239                                                                 "position": {
240                                                                         "type": "string",
241                                                                         "description": "Position on the page to load this module at",
242                                                                         "enum": [
243                                                                                 "bottom",
244                                                                                 "top"
245                                                                         ]
246                                                                 },
247                                                                 "targets": {
248                                                                         "type": ["string", "array"],
249                                                                         "description": "ResourceLoader target the module can run on",
250                                                                         "items": {
251                                                                                 "type": "string"
252                                                                         }
253                                                                 },
254                                                                 "scripts": {
255                                                                         "type": "array",
256                                                                         "description": "A list of on-wiki pages containing JavaScript that should be loaded",
257                                                                         "items": {
258                                                                                 "type": "string"
259                                                                         }
260                                                                 },
261                                                                 "styles": {
262                                                                         "type": "array",
263                                                                         "description": "A list of on-wiki pages containing CSS that should be loaded",
264                                                                         "items": {
265                                                                                 "type": "string"
266                                                                         }
267                                                                 }
268                                                         }
269                                                 },
270                                                 {
271                                                         "description": "A ResourceLoaderImageModule definition",
272                                                         "additionalProperties": false,
273                                                         "properties": {
274                                                                 "class": {
275                                                                         "enum": ["ResourceLoaderImageModule"]
276                                                                 },
277                                                                 "data": {
278                                                                         "type": "string"
279                                                                 },
280                                                                 "prefix": {
281                                                                         "type": "string"
282                                                                 },
283                                                                 "selector": {
284                                                                         "type": "string"
285                                                                 },
286                                                                 "selectorWithoutVariant": {
287                                                                         "type": "string"
288                                                                 },
289                                                                 "selectorWithVariant": {
290                                                                         "type": "string"
291                                                                 },
292                                                                 "variants": {
293                                                                         "type": "object"
294                                                                 },
295                                                                 "images": {
296                                                                         "type": "object"
297                                                                 },
298                                                                 "position": {
299                                                                         "enum": [
300                                                                                 "top",
301                                                                                 "bottom"
302                                                                         ]
303                                                                 }
304                                                         }
305                                                 },
306                                                 {
307                                                         "description": "An arbitrary ResourceLoaderModule definition",
308                                                         "properties": {
309                                                                 "class": {
310                                                                         "type": "string",
311                                                                         "pattern": "^((?!ResourceLoader(File|Image)Module).)*$"
312                                                                 }
313                                                         },
314                                                         "required": ["class"]
315                                                 }
316                                         ]
317                                 }
318                         }
319                 },
320                 "ResourceModuleSkinStyles": {
321                         "type": "object",
322                         "description": "ResourceLoader modules for custom skin styles"
323                 },
324                 "ResourceLoaderSources": {
325                         "type": "object",
326                         "description": "ResourceLoader sources to register"
327                 },
328                 "ResourceLoaderLESSVars": {
329                         "type": "object",
330                         "description": "ResourceLoader LESS variables"
331                 },
332                 "ConfigRegistry": {
333                         "type": "object",
334                         "description": "Registry of factory functions to create Config objects"
335                 },
336                 "SessionProviders": {
337                         "type": "object",
338                         "description": "Session providers"
339                 },
340                 "AuthManagerAutoConfig": {
341                         "type": "object",
342                         "description": "AuthManager auto-configuration",
343                         "additionalProperties": false,
344                         "properties": {
345                                 "preauth": {
346                                         "type": "object",
347                                         "description": "Pre-authentication providers"
348                                 },
349                                 "primaryauth": {
350                                         "type": "object",
351                                         "description": "Primary authentication providers"
352                                 },
353                                 "secondaryauth": {
354                                         "type": "object",
355                                         "description": "Secondary authentication providers"
356                                 }
357                         }
358                 },
359                 "CentralIdLookupProviders": {
360                         "type": "object",
361                         "description": "Central ID lookup providers"
362                 },
363                 "ChangeCredentialsBlacklist": {
364                         "type": "object",
365                         "description": "AuthenticationRequest classes which can only be used internally for credentials change"
366                 },
367                 "RemoveCredentialsBlacklist": {
368                         "type": "object",
369                         "description": "AuthenticationRequest classes which can only be used internally for credentials removal"
370                 },
371                 "namespaces": {
372                         "type": "array",
373                         "description": "Method to add extra namespaces",
374                         "items": {
375                                 "type": "object",
376                                 "properties": {
377                                         "id": {
378                                                 "type": "integer"
379                                         },
380                                         "constant": {
381                                                 "type": "string"
382                                         },
383                                         "name": {
384                                                 "type": "string"
385                                         },
386                                         "gender": {
387                                                 "type": "object",
388                                                 "properties": {
389                                                         "male": {
390                                                                 "type": "string"
391                                                         },
392                                                         "female": {
393                                                                 "type": "string"
394                                                         }
395                                                 }
396                                         },
397                                         "subpages": {
398                                                 "type": "boolean",
399                                                 "default": false
400                                         },
401                                         "content": {
402                                                 "type": "boolean",
403                                                 "default": false
404                                         },
405                                         "defaultcontentmodel": {
406                                                 "type": "string"
407                                         },
408                                         "protection": {
409                                                 "type": ["string", "array"],
410                                                 "description": "Userright(s) required to edit in this namespace"
411                                         },
412                                         "capitallinkoverride": {
413                                                 "type": "boolean",
414                                                 "description": "Set $wgCapitalLinks on a per-namespace basis"
415                                         },
416                                         "conditional": {
417                                                 "type": "boolean",
418                                                 "description": "Whether the namespace is conditional upon configuration and should not be registered (requires separate registration via a hook)",
419                                                 "default": false
420                                         }
421                                 },
422                                 "required": ["id", "constant", "name"]
423                         }
424                 },
425                 "TrackingCategories": {
426                         "type": "array",
427                         "description": "Tracking category message keys",
428                         "items": {
429                                 "type": "string"
430                         }
431                 },
432                 "DefaultUserOptions": {
433                         "type": "object",
434                         "description": "Default values of user options"
435                 },
436                 "HiddenPrefs": {
437                         "type": "array",
438                         "description": "Preferences users cannot set",
439                         "items": {
440                                 "type": "string"
441                         }
442                 },
443                 "GroupPermissions": {
444                         "type": "object",
445                         "description": "Default permissions to give to user groups",
446                         "patternProperties": {
447                                 "^[a-z]+$": {
448                                         "type": "object",
449                                         "patternProperties": {
450                                                 "^[a-z]+$": {
451                                                         "type": "boolean"
452                                                 }
453                                         }
454                                 }
455                         }
456                 },
457                 "RevokePermissions": {
458                         "type": "object",
459                         "description": "Default permissions to revoke from user groups",
460                         "patternProperties": {
461                                 "^[a-z]+$": {
462                                         "type": "object",
463                                         "patternProperties": {
464                                                 "^[a-z]+$": {
465                                                         "type": "boolean"
466                                                 }
467                                         }
468                                 }
469                         }
470                 },
471                 "GrantPermissions": {
472                         "type": "object",
473                         "description": "Map of permissions granted to authorized consumers to their bundles, called 'grants'",
474                         "patternProperties": {
475                                 "^[a-z]+$": {
476                                         "type": "object",
477                                         "patternProperties": {
478                                                 "^[a-z]+$": {
479                                                         "type": "boolean"
480                                                 }
481                                         }
482                                 }
483                         }
484                 },
485                 "GrantPermissionGroups": {
486                         "type": "object",
487                         "description": "Map of grants to their UI grouping",
488                         "patternProperties": {
489                                 "^[a-z]+$": {
490                                         "type": "string"
491                                 }
492                         }
493                 },
494                 "ImplicitGroups": {
495                         "type": "array",
496                         "description": "Implicit groups"
497                 },
498                 "GroupsAddToSelf": {
499                         "type": "object",
500                         "description": "Groups a user can add to themselves"
501                 },
502                 "GroupsRemoveFromSelf": {
503                         "type": "object",
504                         "description": "Groups a user can remove from themselves"
505                 },
506                 "AddGroups": {
507                         "type": "object",
508                         "description": "Groups a user can add to users"
509                 },
510                 "RemoveGroups": {
511                         "type": "object",
512                         "description": "Groups a user can remove from users"
513                 },
514                 "AvailableRights": {
515                         "type": "array",
516                         "description": "User rights added by the extension",
517                         "items": {
518                                 "type": "string"
519                         }
520                 },
521                 "ContentHandlers": {
522                         "type": "object",
523                         "description": "Mapping of model ID to class name",
524                         "patternProperties": {
525                                 "^[A-Za-z]+$": {
526                                         "type": "string"
527                                 }
528                         }
529                 },
530                 "RateLimits": {
531                         "type": "object",
532                         "description": "Rate limits"
533                 },
534                 "RecentChangesFlags": {
535                         "type": "object",
536                         "description": "Flags (letter symbols) shown on RecentChanges pages"
537                 },
538                 "MediaHandlers": {
539                         "type": "object",
540                         "description": "Plugins for media file type handling. Each entry in the array maps a MIME type to a PHP class name."
541                 },
542                 "ExtensionFunctions": {
543                         "type": [
544                                 "array",
545                                 "string"
546                         ],
547                         "description": "Function to call after setup has finished",
548                         "items": {
549                                 "type": "string"
550                         }
551                 },
552                 "ExtensionMessagesFiles": {
553                         "type": "object",
554                         "description": "File paths containing PHP internationalization data"
555                 },
556                 "MessagesDirs": {
557                         "type": "object",
558                         "description": "Directory paths containing JSON internationalization data"
559                 },
560                 "ExtensionEntryPointListFiles": {
561                         "type": "object"
562                 },
563                 "SpecialPages": {
564                         "type": "object",
565                         "description": "SpecialPages implemented in this extension (mapping of page name to class name)"
566                 },
567                 "AutoloadClasses": {
568                         "type": "object"
569                 },
570                 "Hooks": {
571                         "type": [ "string", "object" ],
572                         "description": "Hooks this extension uses (mapping of hook name to callback)"
573                 },
574                 "JobClasses": {
575                         "type": "object",
576                         "description": "Job types this extension implements (mapping of job type to class name)"
577                 },
578                 "LogTypes": {
579                         "type": "array",
580                         "description": "List of new log types this extension uses"
581                 },
582                 "LogRestrictions": {
583                         "type": "object"
584                 },
585                 "FilterLogTypes": {
586                         "type": "object"
587                 },
588                 "ActionFilteredLogs": {
589                         "type": "object",
590                         "description": "List of log types which can be filtered by log actions",
591                         "patternProperties": {
592                                 "^[a-z-]+$": {
593                                         "type": "object",
594                                         "patternProperties": {
595                                                 "^[a-z-]+$": {
596                                                         "type": "array",
597                                                         "items": {
598                                                                 "type": "string"
599                                                         }
600                                                 }
601                                         }
602                                 }
603                         }
604                 },
605                 "LogNames": {
606                         "type": "object"
607                 },
608                 "LogHeaders": {
609                         "type": "object"
610                 },
611                 "LogActions": {
612                         "type": "object"
613                 },
614                 "LogActionsHandlers": {
615                         "type": "object"
616                 },
617                 "Actions": {
618                         "type": "object"
619                 },
620                 "APIModules": {
621                         "type": "object"
622                 },
623                 "APIFormatModules": {
624                         "type": "object"
625                 },
626                 "APIMetaModules": {
627                         "type": "object"
628                 },
629                 "APIPropModules": {
630                         "type": "object"
631                 },
632                 "APIListModules": {
633                         "type": "object"
634                 },
635                 "ValidSkinNames": {
636                         "type": "object"
637                 },
638                 "FeedClasses": {
639                         "type": "object",
640                         "description": "Available feeds objects"
641                 },
642                 "SkinOOUIThemes": {
643                         "type": "object"
644                 },
645                 "callback": {
646                         "type": [
647                                 "array",
648                                 "string"
649                         ],
650                         "description": "A function to be called right after MediaWiki processes this file"
651                 },
652                 "config_prefix": {
653                         "type": "string",
654                         "default": "wg",
655                         "description": "Prefix to put in front of configuration settings when exporting them to $GLOBALS"
656                 },
657                 "config": {
658                         "type": "object",
659                         "description": "Configuration options for this extension",
660                         "patternProperties": {
661                                 "^[a-zA-Z_\u007f-\u00ff][a-zA-Z0-9_\u007f-\u00ff]*$": {
662                                         "type": "object",
663                                         "properties": {
664                                                 "value": {
665                                                         "required": true
666                                                 },
667                                                 "merge_strategy": {
668                                                         "type": "string",
669                                                         "enum": [
670                                                                 "array_merge_recursive",
671                                                                 "array_plus_2d",
672                                                                 "array_plus",
673                                                                 "array_merge"
674                                                         ],
675                                                         "default": "array_merge"
676                                                 },
677                                                 "path": {
678                                                         "description": "Whether this should be interpreted as a filesystem path, relative to extension directory root",
679                                                         "type": "boolean",
680                                                         "default": false
681                                                 },
682                                                 "description": {
683                                                         "type": ["string", "array"],
684                                                         "description": "A description of the config setting, mostly for documentation/developers"
685                                                 }
686                                         }
687                                 }
688                         }
689                 },
690                 "ParserTestFiles": {
691                         "type": "array",
692                         "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
693                 },
694                 "ServiceWiringFiles": {
695                         "type": "array",
696                         "description": "List of service wiring files to be loaded by the default instance of MediaWikiServices"
697                 },
698                 "load_composer_autoloader": {
699                         "type": "boolean",
700                         "description": "Load the composer autoloader for this extension, if one is present"
701                 }
702         }