diff --git a/format-specs/schema.json b/format-specs/schema.json index 7db7ab0..26cddec 100644 --- a/format-specs/schema.json +++ b/format-specs/schema.json @@ -74,7 +74,9 @@ }, "covering": { "type": "object", - "minProperties": 1, + "required": [ + "bbox" + ], "properties": { "bbox": { "type": "object", @@ -83,7 +85,7 @@ "xmin": { "type": "array", "items": [ - { "type": "string" }, + { "type": "string", "minLength": 1 }, { "const": "xmin" } ], "minItems": 2, @@ -92,7 +94,7 @@ "xmax": { "type": "array", "items": [ - { "type": "string" }, + { "type": "string", "minLength": 1 }, { "const": "xmax" } ], "minItems": 2, @@ -101,7 +103,7 @@ "ymin": { "type": "array", "items": [ - { "type": "string" }, + { "type": "string", "minLength": 1 }, { "const": "ymin" } ], "minItems": 2, @@ -110,7 +112,7 @@ "ymax": { "type": "array", "items": [ - { "type": "string" }, + { "type": "string", "minLength": 1 }, { "const": "ymax" } ], "minItems": 2, diff --git a/scripts/test_json_schema.py b/scripts/test_json_schema.py index be0888f..61a1b4b 100644 --- a/scripts/test_json_schema.py +++ b/scripts/test_json_schema.py @@ -221,7 +221,6 @@ def get_version() -> str: }, } - # Allow "any_column.xmin" etc. metadata = copy.deepcopy(metadata_covering_template) valid_cases["valid_default_bbox"] = metadata @@ -235,6 +234,15 @@ def get_version() -> str: } valid_cases["valid_but_not_bbox_struct_name"] = metadata +metadata = copy.deepcopy(metadata_covering_template) +metadata["columns"]["geometry"]["covering"]["bbox"] = { + "xmin": ["", "xmin"], + "ymin": ["", "ymin"], + "xmax": ["", "xmax"], + "ymax": ["", "ymax"], +} +invalid_cases["empty_column_name"] = metadata + metadata = copy.deepcopy(metadata_covering_template) metadata["columns"]["geometry"]["covering"]["bbox"]["xmin"] = [] invalid_cases["xmin_array_length_must_be_2_is_0"] = metadata