feat(config): Schema validator, initial config merger setup

This commit is contained in:
2026-04-23 11:31:01 +02:00
parent 5126e0373f
commit 541a876307
7 changed files with 64 additions and 2 deletions
+18 -2
View File
@@ -1,2 +1,18 @@
def validate():
pass
import json
import jsonschema
with open("config.schema.json") as file:
schema = json.load(file)
def validate(config):
try:
jsonschema.validate(config, schema)
except jsonschema.SchemaError:
print("Schema invalid")
return False
except jsonschema.ValidationError:
print("Config invalid")
return False
return True