Merge "Added release notes for 'ContentHandler::runLegacyHooks' removal"
[mediawiki.git] / docs / extension.schema.v1.json
blob421ea5c732e79329f015e5bea0d0ff095b959050
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 which this module should be loaded together with"
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                                                                 "noflip": {
227                                                                         "type": "boolean",
228                                                                         "description": "Whether to skip CSSJanus LTR-to-RTL flipping for this module. Recommended for styles imported from libraries that already properly handle their RTL styles. Default is false, meaning CSSJanus will be applied on RTL-mode output."
229                                                                 }
230                                                         }
231                                                 },
232                                                 {
233                                                         "description": "A ResourceLoaderWikiModule definition",
234                                                         "additionalProperties": false,
235                                                         "properties": {
236                                                                 "class": {
237                                                                         "enum": ["ResourceLoaderWikiModule"]
238                                                                 },
239                                                                 "group": {
240                                                                         "type": "string",
241                                                                         "description": "Group which this module should be loaded together with"
242                                                                 },
243                                                                 "position": {
244                                                                         "type": "string",
245                                                                         "description": "Position on the page to load this module at",
246                                                                         "enum": [
247                                                                                 "bottom",
248                                                                                 "top"
249                                                                         ]
250                                                                 },
251                                                                 "targets": {
252                                                                         "type": ["string", "array"],
253                                                                         "description": "ResourceLoader target the module can run on",
254                                                                         "items": {
255                                                                                 "type": "string"
256                                                                         }
257                                                                 },
258                                                                 "scripts": {
259                                                                         "type": "array",
260                                                                         "items": {
261                                                                                 "type": "string"
262                                                                         }
263                                                                 },
264                                                                 "styles": {
265                                                                         "type": "array",
266                                                                         "items": {
267                                                                                 "type": "string"
268                                                                         }
269                                                                 }
270                                                         }
271                                                 },
272                                                 {
273                                                         "description": "A ResourceLoaderImageModule definition",
274                                                         "additionalProperties": false,
275                                                         "properties": {
276                                                                 "class": {
277                                                                         "enum": ["ResourceLoaderImageModule"]
278                                                                 },
279                                                                 "data": {
280                                                                         "type": "string"
281                                                                 },
282                                                                 "prefix": {
283                                                                         "type": "string"
284                                                                 },
285                                                                 "selector": {
286                                                                         "type": "string"
287                                                                 },
288                                                                 "selectorWithoutVariant": {
289                                                                         "type": "string"
290                                                                 },
291                                                                 "selectorWithVariant": {
292                                                                         "type": "string"
293                                                                 },
294                                                                 "variants": {
295                                                                         "type": "object"
296                                                                 },
297                                                                 "images": {
298                                                                         "type": "object"
299                                                                 },
300                                                                 "position": {
301                                                                         "enum": [
302                                                                                 "top",
303                                                                                 "bottom"
304                                                                         ]
305                                                                 }
306                                                         }
307                                                 },
308                                                 {
309                                                         "description": "An arbitrary ResourceLoaderModule definition",
310                                                         "properties": {
311                                                                 "class": {
312                                                                         "type": "string",
313                                                                         "pattern": "^((?!ResourceLoader(File|Image)Module).)*$"
314                                                                 }
315                                                         },
316                                                         "required": ["class"]
317                                                 }
318                                         ]
319                                 }
320                         }
321                 },
322                 "ResourceModuleSkinStyles": {
323                         "type": "object",
324                         "description": "ResourceLoader modules for custom skin styles"
325                 },
326                 "ResourceLoaderSources": {
327                         "type": "object",
328                         "description": "ResourceLoader sources to register"
329                 },
330                 "ResourceLoaderLESSVars": {
331                         "type": "object",
332                         "description": "ResourceLoader LESS variables"
333                 },
334                 "ConfigRegistry": {
335                         "type": "object",
336                         "description": "Registry of factory functions to create Config objects"
337                 },
338                 "SessionProviders": {
339                         "type": "object",
340                         "description": "Session providers"
341                 },
342                 "AuthManagerAutoConfig": {
343                         "type": "object",
344                         "description": "AuthManager auto-configuration",
345                         "additionalProperties": false,
346                         "properties": {
347                                 "preauth": {
348                                         "type": "object",
349                                         "description": "Pre-authentication providers"
350                                 },
351                                 "primaryauth": {
352                                         "type": "object",
353                                         "description": "Primary authentication providers"
354                                 },
355                                 "secondaryauth": {
356                                         "type": "object",
357                                         "description": "Secondary authentication providers"
358                                 }
359                         }
360                 },
361                 "CentralIdLookupProviders": {
362                         "type": "object",
363                         "description": "Central ID lookup providers"
364                 },
365                 "namespaces": {
366                         "type": "array",
367                         "description": "Method to add extra namespaces",
368                         "items": {
369                                 "type": "object",
370                                 "properties": {
371                                         "id": {
372                                                 "type": "integer"
373                                         },
374                                         "constant": {
375                                                 "type": "string"
376                                         },
377                                         "name": {
378                                                 "type": "string"
379                                         },
380                                         "gender": {
381                                                 "type": "object",
382                                                 "properties": {
383                                                         "male": {
384                                                                 "type": "string"
385                                                         },
386                                                         "female": {
387                                                                 "type": "string"
388                                                         }
389                                                 }
390                                         },
391                                         "subpages": {
392                                                 "type": "boolean",
393                                                 "default": false
394                                         },
395                                         "content": {
396                                                 "type": "boolean",
397                                                 "default": false
398                                         },
399                                         "defaultcontentmodel": {
400                                                 "type": "string"
401                                         },
402                                         "protection": {
403                                                 "type": ["string", "array"],
404                                                 "description": "Userright(s) required to edit in this namespace"
405                                         },
406                                         "capitallinkoverride": {
407                                                 "type": "boolean",
408                                                 "description": "Set $wgCapitalLinks on a per-namespace basis"
409                                         },
410                                         "conditional": {
411                                                 "type": "boolean",
412                                                 "description": "Whether the namespace is conditional upon configuration and should not be registered (requires separate registration via a hook)",
413                                                 "default": false
414                                         }
415                                 },
416                                 "required": ["id", "constant", "name"]
417                         }
418                 },
419                 "TrackingCategories": {
420                         "type": "array",
421                         "description": "Tracking category message keys",
422                         "items": {
423                                 "type": "string"
424                         }
425                 },
426                 "DefaultUserOptions": {
427                         "type": "object",
428                         "description": "Default values of user options"
429                 },
430                 "HiddenPrefs": {
431                         "type": "array",
432                         "description": "Preferences users cannot set",
433                         "items": {
434                                 "type": "string"
435                         }
436                 },
437                 "GroupPermissions": {
438                         "type": "object",
439                         "description": "Default permissions to give to user groups",
440                         "patternProperties": {
441                                 "^[a-z]+$": {
442                                         "type": "object",
443                                         "patternProperties": {
444                                                 "^[a-z]+$": {
445                                                         "type": "boolean"
446                                                 }
447                                         }
448                                 }
449                         }
450                 },
451                 "RevokePermissions": {
452                         "type": "object",
453                         "description": "Default permissions to revoke from user groups",
454                         "patternProperties": {
455                                 "^[a-z]+$": {
456                                         "type": "object",
457                                         "patternProperties": {
458                                                 "^[a-z]+$": {
459                                                         "type": "boolean"
460                                                 }
461                                         }
462                                 }
463                         }
464                 },
465                 "GrantPermissions": {
466                         "type": "object",
467                         "description": "Map of permissions granted to authorized consumers to their bundles, called 'grants'",
468                         "patternProperties": {
469                                 "^[a-z]+$": {
470                                         "type": "object",
471                                         "patternProperties": {
472                                                 "^[a-z]+$": {
473                                                         "type": "boolean"
474                                                 }
475                                         }
476                                 }
477                         }
478                 },
479                 "GrantPermissionGroups": {
480                         "type": "object",
481                         "description": "Map of grants to their UI grouping",
482                         "patternProperties": {
483                                 "^[a-z]+$": {
484                                         "type": "string"
485                                 }
486                         }
487                 },
488                 "ImplicitGroups": {
489                         "type": "array",
490                         "description": "Implicit groups"
491                 },
492                 "GroupsAddToSelf": {
493                         "type": "object",
494                         "description": "Groups a user can add to themselves"
495                 },
496                 "GroupsRemoveFromSelf": {
497                         "type": "object",
498                         "description": "Groups a user can remove from themselves"
499                 },
500                 "AddGroups": {
501                         "type": "object",
502                         "description": "Groups a user can add to users"
503                 },
504                 "RemoveGroups": {
505                         "type": "object",
506                         "description": "Groups a user can remove from users"
507                 },
508                 "AvailableRights": {
509                         "type": "array",
510                         "description": "User rights added by the extension",
511                         "items": {
512                                 "type": "string"
513                         }
514                 },
515                 "ContentHandlers": {
516                         "type": "object",
517                         "description": "Mapping of model ID to class name",
518                         "patternProperties": {
519                                 "^[A-Za-z]+$": {
520                                         "type": "string"
521                                 }
522                         }
523                 },
524                 "RateLimits": {
525                         "type": "object",
526                         "description": "Rate limits"
527                 },
528                 "RecentChangesFlags": {
529                         "type": "object",
530                         "description": "Flags (letter symbols) shown on RecentChanges pages"
531                 },
532                 "MediaHandlers": {
533                         "type": "object",
534                         "description": "Plugins for media file type handling. Each entry in the array maps a MIME type to a PHP class name."
535                 },
536                 "ExtensionFunctions": {
537                         "type": [
538                                 "array",
539                                 "string"
540                         ],
541                         "description": "Function to call after setup has finished",
542                         "items": {
543                                 "type": "string"
544                         }
545                 },
546                 "ExtensionMessagesFiles": {
547                         "type": "object",
548                         "description": "File paths containing PHP internationalization data"
549                 },
550                 "MessagesDirs": {
551                         "type": "object",
552                         "description": "Directory paths containing JSON internationalization data"
553                 },
554                 "ExtensionEntryPointListFiles": {
555                         "type": "object"
556                 },
557                 "SpecialPages": {
558                         "type": "object",
559                         "description": "SpecialPages implemented in this extension (mapping of page name to class name)"
560                 },
561                 "AutoloadClasses": {
562                         "type": "object"
563                 },
564                 "Hooks": {
565                         "type": [ "string", "object" ],
566                         "description": "Hooks this extension uses (mapping of hook name to callback)"
567                 },
568                 "JobClasses": {
569                         "type": "object",
570                         "description": "Job types this extension implements (mapping of job type to class name)"
571                 },
572                 "LogTypes": {
573                         "type": "array",
574                         "description": "List of new log types this extension uses"
575                 },
576                 "LogRestrictions": {
577                         "type": "object"
578                 },
579                 "FilterLogTypes": {
580                         "type": "object"
581                 },
582                 "ActionFilteredLogs": {
583                         "type": "object",
584                         "description": "List of log types which can be filtered by log actions",
585                         "patternProperties": {
586                                 "^[a-z-]+$": {
587                                         "type": "object",
588                                         "patternProperties": {
589                                                 "^[a-z-]+$": {
590                                                         "type": "array",
591                                                         "items": {
592                                                                 "type": "string"
593                                                         }
594                                                 }
595                                         }
596                                 }
597                         }
598                 },
599                 "LogNames": {
600                         "type": "object"
601                 },
602                 "LogHeaders": {
603                         "type": "object"
604                 },
605                 "LogActions": {
606                         "type": "object"
607                 },
608                 "LogActionsHandlers": {
609                         "type": "object"
610                 },
611                 "Actions": {
612                         "type": "object"
613                 },
614                 "APIModules": {
615                         "type": "object"
616                 },
617                 "APIFormatModules": {
618                         "type": "object"
619                 },
620                 "APIMetaModules": {
621                         "type": "object"
622                 },
623                 "APIPropModules": {
624                         "type": "object"
625                 },
626                 "APIListModules": {
627                         "type": "object"
628                 },
629                 "ValidSkinNames": {
630                         "type": "object"
631                 },
632                 "FeedClasses": {
633                         "type": "object",
634                         "description": "Available feeds objects"
635                 },
636                 "SkinOOUIThemes": {
637                         "type": "object"
638                 },
639                 "PasswordPolicy": {
640                         "type": "object",
641                         "description": "Password policies"
642                 },
643                 "FileExtensions": {
644                         "type": "array",
645                         "description": "Preferred file extensions for uploading",
646                         "items": {
647                                 "type": "string"
648                         }
649                 },
650                 "callback": {
651                         "type": [
652                                 "array",
653                                 "string"
654                         ],
655                         "description": "A function to be called right after MediaWiki processes this file"
656                 },
657                 "config": {
658                         "type": "object",
659                         "description": "Configuration options for this extension",
660                         "properties": {
661                                 "_prefix": {
662                                         "type": "string",
663                                         "default": "wg",
664                                         "description": "Prefix to put in front of configuration settings when exporting them to $GLOBALS"
665                                 }
666                         },
667                         "patternProperties": {
668                                 "^[a-zA-Z_\u007f-\u00ff][a-zA-Z0-9_\u007f-\u00ff]*$": {
669                                         "properties": {
670                                                 "_merge_strategy": {
671                                                         "type": "string",
672                                                         "enum": [
673                                                                 "array_merge_recursive",
674                                                                 "array_replace_recursive",
675                                                                 "array_plus_2d",
676                                                                 "array_plus",
677                                                                 "array_merge"
678                                                         ],
679                                                         "default": "array_merge"
680                                                 }
681                                         }
682                                 }
683                         }
684                 },
685                 "ParserTestFiles": {
686                         "type": "array",
687                         "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
688                 },
689                 "ServiceWiringFiles": {
690                         "type": "array",
691                         "description": "List of service wiring files to be loaded by the default instance of MediaWikiServices"
692                 },
693                 "load_composer_autoloader": {
694                         "type": "boolean",
695                         "description": "Load the composer autoloader for this extension, if one is present"
696                 }
697         }