diff --git a/format-specs/schema.json b/format-specs/schema.json index d0e928b..26cddec 100644 --- a/format-specs/schema.json +++ b/format-specs/schema.json @@ -88,7 +88,8 @@ { "type": "string", "minLength": 1 }, { "const": "xmin" } ], - "additionalItems": false + "minItems": 2, + "maxItems": 2 }, "xmax": { "type": "array", @@ -96,7 +97,8 @@ { "type": "string", "minLength": 1 }, { "const": "xmax" } ], - "additionalItems": false + "minItems": 2, + "maxItems": 2 }, "ymin": { "type": "array", @@ -104,7 +106,8 @@ { "type": "string", "minLength": 1 }, { "const": "ymin" } ], - "additionalItems": false + "minItems": 2, + "maxItems": 2 }, "ymax": { "type": "array", @@ -112,7 +115,8 @@ { "type": "string", "minLength": 1 }, { "const": "ymax" } ], - "additionalItems": false + "minItems": 2, + "maxItems": 2 } } } diff --git a/scripts/test_json_schema.py b/scripts/test_json_schema.py index ddb4062..61a1b4b 100644 --- a/scripts/test_json_schema.py +++ b/scripts/test_json_schema.py @@ -243,6 +243,26 @@ def get_version() -> str: } 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 + +metadata = copy.deepcopy(metadata_covering_template) +metadata["columns"]["geometry"]["covering"]["bbox"]["ymax"] = [] +invalid_cases["ymax_array_length_must_be_2_is_0"] = metadata + +metadata = copy.deepcopy(metadata_covering_template) +metadata["columns"]["geometry"]["covering"]["bbox"]["ymin"] = ["column"] +invalid_cases["ymin_array_length_must_be_2_is_1"] = metadata + +metadata = copy.deepcopy(metadata_covering_template) +metadata["columns"]["geometry"]["covering"]["bbox"]["xmax"] = ["column"] +invalid_cases["xmax_array_length_must_be_2_is_1"] = metadata + +metadata = copy.deepcopy(metadata_covering_template) +metadata["columns"]["geometry"]["covering"]["bbox"]["xmin"] = ["xmin", "xmin", "xmin"] +invalid_cases["xmin_array_length_must_be_2_is_3"] = metadata + metadata = copy.deepcopy(metadata_covering_template) metadata["columns"]["geometry"]["covering"].pop("bbox") invalid_cases["empty_geometry_bbox"] = metadata