Skip to content

Commit 2e6947d

Browse files
authored
Merge pull request #1307 from radiantearth/editorial
Fix item_asset and bands schema, fix typos
2 parents ceff596 + 6ce2722 commit 2e6947d

File tree

5 files changed

+64
-68
lines changed

5 files changed

+64
-68
lines changed

best-practices.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -550,9 +550,9 @@ As such you can deduplicate those properties and list them in the asset directly
550550

551551
It should be relatively simple to migrate from STAC 1.0 (i.e. `eo:bands` and/or `raster:bands`) to the new `bands` array.
552552

553-
Usually, you can simply merge the each object on a by-index basis.
553+
Usually, you can simply merge each object on a by-index basis.
554554
Nevertheless, you should consider deduplicating properties with the same values across all bands to the Asset.
555-
For some fields you need to add the extension prefix of the `eo` or `raster` extension to the property name.
555+
For some fields, you need to add the extension prefix of the `eo` or `raster` extension to the property name.
556556

557557
STAC 1.0 example:
558558

collection-spec/json-schema/collection.json

+32-30
Original file line numberDiff line numberDiff line change
@@ -132,40 +132,42 @@
132132
"$ref": "../../item-spec/json-schema/item.json#/definitions/assets"
133133
},
134134
"item_assets": {
135-
"allOf": [
136-
{
137-
"type": "object",
138-
"minProperties": 2,
139-
"properties": {
140-
"href": {
141-
"title": "Disallow href",
142-
"not": {}
143-
},
144-
"title": {
145-
"title": "Asset title",
146-
"type": "string"
147-
},
148-
"description": {
149-
"title": "Asset description",
150-
"type": "string"
151-
},
152-
"type": {
153-
"title": "Asset type",
154-
"type": "string"
155-
},
156-
"roles": {
157-
"title": "Asset roles",
158-
"type": "array",
159-
"items": {
135+
"additionalProperties": {
136+
"allOf": [
137+
{
138+
"type": "object",
139+
"minProperties": 2,
140+
"properties": {
141+
"href": {
142+
"title": "Disallow href",
143+
"not": {}
144+
},
145+
"title": {
146+
"title": "Asset title",
147+
"type": "string"
148+
},
149+
"description": {
150+
"title": "Asset description",
160151
"type": "string"
152+
},
153+
"type": {
154+
"title": "Asset type",
155+
"type": "string"
156+
},
157+
"roles": {
158+
"title": "Asset roles",
159+
"type": "array",
160+
"items": {
161+
"type": "string"
162+
}
161163
}
162164
}
165+
},
166+
{
167+
"$ref": "../../item-spec/json-schema/common.json"
163168
}
164-
},
165-
{
166-
"$ref": "../../item-spec/json-schema/common.json"
167-
}
168-
]
169+
]
170+
}
169171
},
170172
"links": {
171173
"$ref": "../../item-spec/json-schema/item.json#/definitions/links"

commons/common-metadata.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -236,10 +236,10 @@ Please refer to the [Bands best practices](../best-practices.md#bands) for more
236236
> \[!NOTE]
237237
> This property is the successor of the `eo:bands` and `raster:bands` fields, which has been present in previous versions of these extensions.
238238
> The behavior is very similar and they can be migrated easily.
239-
> Usually, you can simply merge the each object on a by-index basis.
239+
> Usually, you can simply merge each object on a by-index basis.
240240
> Nevertheless, you should consider deduplicating properties with the same values across all bands to the asset level
241241
> (see the [best practices](../best-practices.md#multiple-bands)).
242-
> For some fields you need to add the extension prefix of the `eo` or `raster` extension to the property name though.
242+
> For some fields, you need to add the extension prefix of the `eo` or `raster` extension to the property name though.
243243
> See the [Band migration best practice](../best-practices.md#band-migration) for details.
244244
245245
### Band Object

item-spec/json-schema/bands.json

+21-21
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
{
2-
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "https://schemas.stacspec.org/v1.1.0-beta.1/item-spec/json-schema/bands.json",
4-
"title": "Bands Field",
5-
"type": "object",
6-
"properties": {
7-
"bands": {
8-
"type": "array",
9-
"items": {
10-
"type": "object",
11-
"properties": {
12-
"name": {
13-
"type": "string"
14-
}
15-
},
16-
"allOf": [
17-
{
18-
"$ref": "common.json"
19-
}
20-
]
21-
}
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"$id": "https://schemas.stacspec.org/v1.1.0-beta.1/item-spec/json-schema/bands.json",
4+
"title": "Bands Field",
5+
"type": "object",
6+
"properties": {
7+
"bands": {
8+
"type": "array",
9+
"items": {
10+
"type": "object",
11+
"properties": {
12+
"name": {
13+
"type": "string"
14+
}
15+
},
16+
"allOf": [
17+
{
18+
"$ref": "common.json"
19+
}
20+
]
2221
}
2322
}
24-
}
23+
}
24+
}

item-spec/json-schema/item.json

+7-13
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172
{
173173
"$comment": "The if-then-else below checks whether the bands field is given in assets or not. If not, allows bands in properties (then), otherwise, disallows bands in properties (else).",
174174
"if": {
175+
"$comment": "If there is no asset with bands...",
175176
"required": [
176177
"assets"
177178
],
@@ -187,27 +188,20 @@
187188
}
188189
},
189190
"then": {
191+
"$comment": "... then bands are not allowed in properties...",
190192
"properties": {
191193
"properties": {
192-
"anyOf": [
193-
{
194-
"$ref": "bands.json"
195-
},
196-
{
197-
"properties": {
198-
"bands": false
199-
}
200-
}
201-
]
194+
"properties": {
195+
"bands": false
196+
}
202197
}
203198
}
204199
},
205200
"else": {
201+
"$comment": "... otherwise bands are allowed in properties.",
206202
"properties": {
207203
"properties": {
208-
"properties": {
209-
"bands": false
210-
}
204+
"$ref": "bands.json"
211205
}
212206
}
213207
}

0 commit comments

Comments
 (0)