Skip to content

Commit

Permalink
Merge branch 'main' into m-mohr-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr authored May 6, 2024
2 parents f0a4483 + 0128483 commit 0723ce5
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
12 changes: 8 additions & 4 deletions format-specs/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,31 +88,35 @@
{ "type": "string", "minLength": 1 },
{ "const": "xmin" }
],
"additionalItems": false
"minItems": 2,
"maxItems": 2
},
"xmax": {
"type": "array",
"items": [
{ "type": "string", "minLength": 1 },
{ "const": "xmax" }
],
"additionalItems": false
"minItems": 2,
"maxItems": 2
},
"ymin": {
"type": "array",
"items": [
{ "type": "string", "minLength": 1 },
{ "const": "ymin" }
],
"additionalItems": false
"minItems": 2,
"maxItems": 2
},
"ymax": {
"type": "array",
"items": [
{ "type": "string", "minLength": 1 },
{ "const": "ymax" }
],
"additionalItems": false
"minItems": 2,
"maxItems": 2
}
}
}
Expand Down
20 changes: 20 additions & 0 deletions scripts/test_json_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0723ce5

Please sign in to comment.