From 58a78a53930fa34ebda31bf9ffa8ce01cf869785 Mon Sep 17 00:00:00 2001 From: Tyler Battle Date: Fri, 20 Aug 2021 04:22:46 -0700 Subject: [PATCH] `name` in `label:classes` can only be null if `label:type` is "raster" --- json-schema/schema.json | 54 +++++++++++++++++++++++++++++++++-------- 1 file changed, 44 insertions(+), 10 deletions(-) diff --git a/json-schema/schema.json b/json-schema/schema.json index 8489f44..033a390 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -144,16 +144,7 @@ ], "properties": { "name": { - "title": "Name", - "oneOf": [ - { - "type": "string", - "minLength": 1 - }, - { - "type": "null" - } - ] + "title": "Name" }, "classes": { "title": "Classes", @@ -250,6 +241,49 @@ } } }, + "if": { + "properties": { + "label:type": { + "const": "raster" + } + } + }, + "then": { + "properties": { + "label:classes": { + "items": { + "properties": { + "name": { + "oneOf": [ + { + "type": "string", + "minLength": 1 + }, + { + "type": "null" + } + ] + } + } + } + } + } + }, + "else": { + "properties": { + "label:classes": { + "items": { + "properties": { + "name": { + "type": "string", + "minLength": 1 + } + } + } + } + } + } + }, "patternProperties": { "^(?!label:)": {} },