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