Pārlūkot izejas kodu

Restrict "feature" and "animation" keys (#21895)

Joel Challis 2 gadi atpakaļ
vecāks
revīzija
cdff9b8da7

+ 4 - 0
data/schemas/definitions.jsonschema

@@ -29,6 +29,10 @@
         "minLength": 1,
         "maxLength": 250
     },
+    "snake_case": {
+        "type": "string",
+        "pattern": "^[a-z][a-z0-9_]*$"
+    },
     "layout_macro": {
         "oneOf": [
             {

+ 8 - 1
data/schemas/keyboard.jsonschema

@@ -256,7 +256,11 @@
                 "enabled": {"type": "boolean"}
             }
         },
-        "features": {"$ref": "qmk.definitions.v1#/boolean_array"},
+        "features": {
+            "$ref": "qmk.definitions.v1#/boolean_array",
+            "propertyNames": { "$ref": "qmk.definitions.v1#/snake_case" }
+
+        },
         "indicators": {
             "type": "object",
             "properties": {
@@ -370,6 +374,7 @@
             "properties": {
                 "animations": {
                     "type": "object",
+                    "propertyNames": { "$ref": "qmk.definitions.v1#/snake_case" }
                     "additionalProperties": {
                         "type": "boolean"
                     }
@@ -419,6 +424,7 @@
             "properties": {
                 "animations": {
                     "type": "object",
+                    "propertyNames": { "$ref": "qmk.definitions.v1#/snake_case" }
                     "additionalProperties": {
                         "type": "boolean"
                     }
@@ -471,6 +477,7 @@
             "properties": {
                 "animations": {
                     "type": "object",
+                    "propertyNames": { "$ref": "qmk.definitions.v1#/snake_case" }
                     "additionalProperties": {
                         "type": "boolean"
                     }