Skip to content

Commit

Permalink
Restrict "feature" and "animation" keys (qmk#21895)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvecr authored Sep 20, 2023
1 parent 16ad362 commit cdff9b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions data/schemas/definitions.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
"minLength": 1,
"maxLength": 250
},
"snake_case": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]*$"
},
"layout_macro": {
"oneOf": [
{
Expand Down
9 changes: 8 additions & 1 deletion data/schemas/keyboard.jsonschema
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -370,6 +374,7 @@
"properties": {
"animations": {
"type": "object",
"propertyNames": { "$ref": "qmk.definitions.v1#/snake_case" }
"additionalProperties": {
"type": "boolean"
}
Expand Down Expand Up @@ -419,6 +424,7 @@
"properties": {
"animations": {
"type": "object",
"propertyNames": { "$ref": "qmk.definitions.v1#/snake_case" }
"additionalProperties": {
"type": "boolean"
}
Expand Down Expand Up @@ -471,6 +477,7 @@
"properties": {
"animations": {
"type": "object",
"propertyNames": { "$ref": "qmk.definitions.v1#/snake_case" }
"additionalProperties": {
"type": "boolean"
}
Expand Down

0 comments on commit cdff9b8

Please sign in to comment.