Optimize our jsonschema by using refs (#13271)
* fix some broken info.json files * optimize our jsonschema using refs * fix formatting after vscode broke it * make flake8 happy * cleanup * make our schema validation more compact and flexible
This commit is contained in:
parent
9d4412cb8b
commit
b908275354
9 changed files with 351 additions and 310 deletions
|
@ -9,7 +9,7 @@ from milc import cli
|
|||
|
||||
from qmk.constants import CHIBIOS_PROCESSORS, LUFA_PROCESSORS, VUSB_PROCESSORS
|
||||
from qmk.c_parse import find_layouts
|
||||
from qmk.json_schema import deep_update, json_load, keyboard_validate, keyboard_api_validate
|
||||
from qmk.json_schema import deep_update, json_load, validate
|
||||
from qmk.keyboard import config_h, rules_mk
|
||||
from qmk.keymap import list_keymaps
|
||||
from qmk.makefile import parse_rules_mk_file
|
||||
|
@ -66,7 +66,7 @@ def info_json(keyboard):
|
|||
|
||||
# Validate against the jsonschema
|
||||
try:
|
||||
keyboard_api_validate(info_data)
|
||||
validate(info_data, 'qmk.api.keyboard.v1')
|
||||
|
||||
except jsonschema.ValidationError as e:
|
||||
json_path = '.'.join([str(p) for p in e.absolute_path])
|
||||
|
@ -490,7 +490,7 @@ def merge_info_jsons(keyboard, info_data):
|
|||
continue
|
||||
|
||||
try:
|
||||
keyboard_validate(new_info_data)
|
||||
validate(new_info_data, 'qmk.keyboard.v1')
|
||||
except jsonschema.ValidationError as e:
|
||||
json_path = '.'.join([str(p) for p in e.absolute_path])
|
||||
cli.log.error('Not including data from file: %s', info_file)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue