fix(validation): say no keys are accepted when a dict declares none

This commit is contained in:
2026-10-05 18:55:22 +02:00
parent 881c20e4da
commit 8f1c1a775a
+2 -1
View File
@@ -103,7 +103,8 @@ class _Validator:
return
for key in value:
if key not in options:
self.errors.append(f"{path}.{key}: unsupported key, {path} accepts {', '.join(sorted(options))}")
accepted = ", ".join(sorted(options)) or "no keys"
self.errors.append(f"{path}.{key}: unsupported key, {path} accepts {accepted}")
for key, spec in options.items():
if key in value:
self.check(spec, value[key], f"{path}.{key}")