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 31b43f8
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 42 deletions.
7 changes: 4 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
Expand All @@ -9,14 +10,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- `eo:cloud_cover` and `eo:snow_cover` can be used in bands
- `eo:common_name`, `eo:center_wavelength`, `eo:full_width_half_max` and `eo:solar_illumination` can be used in Assets and Item Properties
- `eo:common_name`, `eo:center_wavelength`, `eo:full_width_half_max` and `eo:solar_illumination`
can be used in Assets and Item Properties

### Changed

- `eo:bands` is now using the more general `bands` construct from STAC common metadata
- The following fields in the Band Object have been moved/renamed:
- `name` was *not* renamed, but has been moved to STAC common metadata
- `description` was *not* renamed, but has been moved to STAC common metadata
- `name` and `description` were *not* renamed, but have been moved to STAC common metadata
- `common_name` has been renamed to `eo:common_name`
- `center_wavelength` has been renamed to `eo:center_wavelength`
- `full_width_half_max` has been renamed to `eo:full_width_half_max`
Expand Down
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 31b43f8

Please sign in to comment.