From 8a48f1933194cdb89fdf2a6a2920a30a5a67e855 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Sun, 28 Apr 2024 00:13:04 +0200 Subject: [PATCH 1/2] Improves Covering Schema #208 --- format-specs/schema.json | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/format-specs/schema.json b/format-specs/schema.json index 241d68e..d0e928b 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" } ], "additionalItems": false @@ -91,7 +93,7 @@ "xmax": { "type": "array", "items": [ - { "type": "string" }, + { "type": "string", "minLength": 1 }, { "const": "xmax" } ], "additionalItems": false @@ -99,7 +101,7 @@ "ymin": { "type": "array", "items": [ - { "type": "string" }, + { "type": "string", "minLength": 1 }, { "const": "ymin" } ], "additionalItems": false @@ -107,7 +109,7 @@ "ymax": { "type": "array", "items": [ - { "type": "string" }, + { "type": "string", "minLength": 1 }, { "const": "ymax" } ], "additionalItems": false From f0a448335eb1d76de2ce0dd8071286d3114a80f9 Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Sun, 28 Apr 2024 23:47:23 +0200 Subject: [PATCH 2/2] Add test --- scripts/test_json_schema.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/test_json_schema.py b/scripts/test_json_schema.py index f0217c1..ddb4062 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"].pop("bbox") invalid_cases["empty_geometry_bbox"] = metadata