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