From 3844cde97b6445410b95976403ea49cb75914d79 Mon Sep 17 00:00:00 2001 From: Astro Date: Thu, 11 Feb 2021 23:43:52 +0100 Subject: [PATCH] jsonschema: validate hw_dev depending on target --- .../coredevice/coredevice_generic.schema.json | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/artiq/coredevice/coredevice_generic.schema.json b/artiq/coredevice/coredevice_generic.schema.json index 5252cd9f1..00008b329 100644 --- a/artiq/coredevice/coredevice_generic.schema.json +++ b/artiq/coredevice/coredevice_generic.schema.json @@ -11,7 +11,6 @@ }, "target": { "type": "string", - "enum": ["kasli", "kasli_soc"], "description": "Target board" }, "variant": { @@ -24,7 +23,6 @@ }, "hw_rev": { "type": "string", - "enum": ["v1.0", "v1.1", "v2.0"], "description": "Hardware revision" }, "base": { @@ -76,6 +74,33 @@ "required": ["target", "variant", "hw_rev", "base", "peripherals"], "additionalProperties": false, + "oneOf": [ + { + "properties": { + "target": { + "type": "string", + "const": "kasli" + }, + "hw_rev": { + "type": "string", + "enum": ["v1.0", "v1.1", "v2.0"] + } + } + }, + { + "properties": { + "target": { + "type": "string", + "const": "kasli_soc" + }, + "hw_rev": { + "type": "string", + "enum": ["v1.0"] + } + } + } + ], + "definitions": { "peripheral": { "type": "object",