Skip to content

Commit

Permalink
Fix JSON Schema for recent bands PR
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mohr committed Jul 8, 2024
1 parent 8a2cc4c commit 7ebd03e
Showing 1 changed file with 19 additions and 39 deletions.
58 changes: 19 additions & 39 deletions json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
{
"properties": {
"properties": {
"$ref": "#/definitions/require_any"
"$ref": "#/definitions/require_any_or_bands"
}
}
},
Expand Down Expand Up @@ -78,63 +78,43 @@
{
"properties": {
"summaries": {
"$ref": "#/definitions/require_any"
"$ref": "#/definitions/require_any_or_bands"
}
}
}
]
}
],
"definitions": {
"require_any": {
"require_any_or_bands": {
"anyOf": [
{
"required": [
"eo:cloud_cover"
]
},
{
"required": [
"eo:snow_cover"
]
},
{
"required": [
"eo:common_name"
]
},
{
"required": [
"eo:center_wavelength"
]
},
{
"required": [
"eo:full_width_half_max"
]
},
{
"required": [
"eo:solar_illumination"
]
"$ref": "#/definitions/require_any"
},
{
"$ref": "#/definitions/require_in_bands"
}
]
},
"require_any": {
"anyOf": [
{"required": ["eo:cloud_cover"]},
{"required": ["eo:snow_cover"]},
{"required": ["eo:common_name"]},
{"required": ["eo:center_wavelength"]},
{"required": ["eo:full_width_half_max"]},
{"required": ["eo:solar_illumination"]}
]
},
"require_in_bands": {
"required": [
"bands"
],
"properties": {
"bands": {
"not": {
"additionalProperties": {
"not": {
"$ref": "#/definitions/require_any"
}
}
"type": "array",
"contains": {
"$ref": "#/definitions/require_any"
}
}
}
Expand All @@ -148,7 +128,7 @@
"not": {
"additionalProperties": {
"not": {
"$ref": "#/definitions/require_any"
"$ref": "#/definitions/require_any_or_bands"
}
}
}
Expand All @@ -164,7 +144,7 @@
"not": {
"additionalProperties": {
"not": {
"$ref": "#/definitions/require_any"
"$ref": "#/definitions/require_any_or_bands"
}
}
}
Expand Down

0 comments on commit 7ebd03e

Please sign in to comment.