registration: Improve schema validation for some properties
authorKunal Mehta <legoktm@member.fsf.org>
Mon, 25 Apr 2016 22:48:54 +0000 (15:48 -0700)
committerKunal Mehta <legoktm@member.fsf.org>
Mon, 25 Apr 2016 22:48:54 +0000 (15:48 -0700)
Adds more detailed validation for a few different properties.

Change-Id: Ie379fffcf79b451900a69564d4e80a5b5599ab87

docs/extension.schema.json

index f1decd3..3c2c057 100644 (file)
                },
                "TrackingCategories": {
                        "type": "array",
-                       "description": "Tracking category message keys"
+                       "description": "Tracking category message keys",
+                       "items": {
+                               "type": "string"
+                       }
                },
                "DefaultUserOptions": {
                        "type": "object",
                },
                "HiddenPrefs": {
                        "type": "array",
-                       "description": "Preferences users cannot set"
+                       "description": "Preferences users cannot set",
+                       "items": {
+                               "type": "string"
+                       }
                },
                "GroupPermissions": {
                        "type": "object",
-                       "description": "Default permissions to give to user groups"
+                       "description": "Default permissions to give to user groups",
+                       "patternProperties": {
+                               "^[a-z]+$": {
+                                       "type": "object",
+                                       "patternProperties": {
+                                               "^[a-z]+$": {
+                                                       "type": "boolean"
+                                               }
+                                       }
+                               }
+                       }
                },
                "RevokePermissions": {
                        "type": "object",
-                       "description": "Default permissions to revoke from user groups"
+                       "description": "Default permissions to revoke from user groups",
+                       "patternProperties": {
+                               "^[a-z]+$": {
+                                       "type": "object",
+                                       "patternProperties": {
+                                               "^[a-z]+$": {
+                                                       "type": "boolean"
+                                               }
+                                       }
+                               }
+                       }
                },
                "ImplicitGroups": {
                        "type": "array",
                },
                "AvailableRights": {
                        "type": "array",
-                       "description": "User rights added by the extension"
+                       "description": "User rights added by the extension",
+                       "items": {
+                               "type": "string"
+                       }
                },
                "ContentHandlers": {
                        "type": "object",
-                       "description": "Mapping of model ID to class name"
+                       "description": "Mapping of model ID to class name",
+                       "patternProperties": {
+                               "^[A-Za-z]+$": {
+                                       "type": "string"
+                               }
+                       }
                },
                "RateLimits": {
                        "type": "object",
                                "array",
                                "string"
                        ],
-                       "description": "Function to call after setup has finished"
+                       "description": "Function to call after setup has finished",
+                       "items": {
+                               "type": "string"
+                       }
                },
                "ExtensionMessagesFiles": {
                        "type": "object",