jsonschema: validate hw_dev depending on target

This commit is contained in:
Astro 2021-02-11 23:43:52 +01:00 committed by Sébastien Bourdeauducq
parent 22ce5b0299
commit 3844cde97b
1 changed files with 27 additions and 2 deletions

View File

@ -11,7 +11,6 @@
}, },
"target": { "target": {
"type": "string", "type": "string",
"enum": ["kasli", "kasli_soc"],
"description": "Target board" "description": "Target board"
}, },
"variant": { "variant": {
@ -24,7 +23,6 @@
}, },
"hw_rev": { "hw_rev": {
"type": "string", "type": "string",
"enum": ["v1.0", "v1.1", "v2.0"],
"description": "Hardware revision" "description": "Hardware revision"
}, },
"base": { "base": {
@ -76,6 +74,33 @@
"required": ["target", "variant", "hw_rev", "base", "peripherals"], "required": ["target", "variant", "hw_rev", "base", "peripherals"],
"additionalProperties": false, "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": { "definitions": {
"peripheral": { "peripheral": {
"type": "object", "type": "object",