registration: Allow @-prefixed keys in manifest_version 2
authorStanislav Malyshev <smalyshev@gmail.com>
Fri, 8 Feb 2019 20:13:49 +0000 (12:13 -0800)
committerKunal Mehta <legoktm@member.fsf.org>
Wed, 13 Feb 2019 02:50:14 +0000 (18:50 -0800)
As specified in
<https://www.mediawiki.org/wiki/Manual:Extension_registration#Retaining_documentation>.

Bug: T215650
Change-Id: I2ff523828389fbec39cdf7c55046e7da901a2ecb

docs/extension.schema.v2.json
tests/phpunit/data/registration/good.json

index 9da636f..1936cdc 100644 (file)
@@ -3,6 +3,12 @@
        "description": "MediaWiki extension.json schema",
        "type": "object",
        "additionalProperties": false,
+       "patternProperties": {
+               "^@": {
+                       "type": "string",
+                       "description": "Arbitrary notes, ignored by the parser."
+               }
+       },
        "properties": {
                "manifest_version": {
                        "type": "integer",
index cfad069..8c02466 100644 (file)
@@ -1,5 +1,7 @@
 {
        "name": "FooBar",
+       "@note": "This is a note",
+       "@duck": "Docs say any @-item is ignored",
        "attributes": {
                "FooBar": {
                        "Attr": [ "test" ]
@@ -8,5 +10,12 @@
                        "Attr": [ "test2" ]
                }
        },
+       "config": {
+               "MyConfigValue": {
+                       "value": 42,
+                       "description": "Very important config value",
+                       "public": true
+               }
+       },
        "manifest_version": 2
 }