registration: Don't hardcode list of extension types in schema
[lhc/web/wiklou.git] / docs / extension.schema.json
index d1b982c..05f0c45 100644 (file)
@@ -3,6 +3,11 @@
        "description": "MediaWiki extension.json schema",
        "type": "object",
        "properties": {
+               "manifest_version": {
+                       "type": "integer",
+                       "description": "Version of the extension.json schema the extension.json file is in.",
+                       "required": true
+               },
                "name": {
                        "type": "string",
                        "description": "The extension's canonical name.",
                "type": {
                        "type": "string",
                        "description": "The extension's type, as an index to $wgExtensionCredits.",
-                       "default": "other",
-                       "enum": [
-                               "api",
-                               "antispam",
-                               "datavalues",
-                               "media",
-                               "parserhook",
-                               "semantic",
-                               "skin",
-                               "specialpage",
-                               "variable",
-                               "other"
-                       ]
+                       "default": "other"
                },
                "author": {
                        "type": [
                                }
                        }
                },
-               "ResourceLoaderModules": {
+               "ResourceModules": {
                        "type": "object",
                        "description": "ResourceLoader modules to register",
                        "additionalProperties": false,
                        "patternProperties": {
-                               "^[a-zA-Z0-9\\.]+$": {
+                               "^[a-zA-Z0-9-\\.]+$": {
                                        "type": "object",
                                        "description": "A single ResourceLoader module descriptor",
                                        "properties": {
                                                        "description": "Equivalent of remoteBasePath, but relative to $wgExtensionAssetsPath"
                                                },
                                                "scripts": {
-                                                       "type": "array",
+                                                       "type": ["string", "array"],
                                                        "description": "Scripts to always include (array of file paths)",
                                                        "items": {
                                                                "type": "string"
                                                        }
                                                },
                                                "debugScripts": {
-                                                       "type": "array",
+                                                       "type": ["string", "array"],
                                                        "description": "Scripts to include in debug contexts",
                                                        "items": {
                                                                "type": "string"
                                                        }
                                                },
                                                "loaderScripts": {
-                                                       "type": "array",
+                                                       "type": ["string", "array"],
                                                        "description": "Scripts to include in the startup module",
                                                        "items": {
                                                                "type": "string"
                                                        }
                                                },
                                                "dependencies": {
-                                                       "type": "array",
+                                                       "type": ["string", "array"],
                                                        "description": "Modules which must be loaded before this module",
                                                        "items": {
                                                                "type": "string"
                                                        }
                                                },
                                                "styles": {
-                                                       "type": "array",
+                                                       "type": ["string", "array", "object"],
                                                        "description": "Styles to always load",
                                                        "items": {
                                                                "type": "string"
                                                        }
                                                },
                                                "messages": {
-                                                       "type": "array",
+                                                       "type": ["string", "array"],
                                                        "description": "Messages to always load",
                                                        "items": {
                                                                "type": "string"
                        "type": "object",
                        "description": "Rate limits"
                },
-               "ParserTestFiles": {
-                       "type": "array",
-                       "description": "Parser test files to run"
-               },
                "RecentChangesFlags": {
                        "type": "object",
                        "description": "Flags (letter symbols) shown on RecentChanges pages"
                },
+               "MediaHandlers": {
+                       "type": "object",
+                       "description": "Plugins for media file type handling. Each entry in the array maps a MIME type to a PHP class name."
+               },
                "ExtensionFunctions": {
                        "type": [
                                "array",
                        "type": "object",
                        "description": "SpecialPages implemented in this extension (mapping of page name to class name)"
                },
-               "SpecialPageGroups": {
-                       "type": "object",
-                       "description": "Mapping of special page name to group it belongs to"
-               },
                "AutoloadClasses": {
                        "type": "object"
                },
                "config": {
                        "type": "object",
                        "description": "Configuration options for this extension"
+               },
+               "ParserTestFiles": {
+                       "type": "array",
+                       "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
                }
        }
 }