Skip to content

Commit b4eb788

Browse files
authored
Merge pull request #832 from radiantearth/json-schemas
Fix JSON Schemas
2 parents 9e755c3 + c5aee7c commit b4eb788

File tree

6 files changed

+116
-100
lines changed

6 files changed

+116
-100
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1313
### Removed
1414

1515
### Fixed
16+
- Fixed several JSON Schemas
1617
- Fixed examples
1718

1819
## [v1.0.0-beta.1] - 2020-05-29

extensions/datacube/json-schema/schema.json

Lines changed: 90 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -117,19 +117,19 @@
117117
]
118118
},
119119
"description": {
120-
"$ref": "#/definitions/fields/description"
120+
"$ref": "#/definitions/description"
121121
},
122122
"extent": {
123-
"$ref": "#/definitions/fields/extent_open"
123+
"$ref": "#/definitions/extent_open"
124124
},
125125
"values": {
126-
"$ref": "#/definitions/fields/values"
126+
"$ref": "#/definitions/values"
127127
},
128128
"step": {
129-
"$ref": "#/definitions/fields/step"
129+
"$ref": "#/definitions/step"
130130
},
131131
"unit": {
132-
"$ref": "#/definitions/fields/unit"
132+
"$ref": "#/definitions/unit"
133133
},
134134
"reference_system": {
135135
"type": "string"
@@ -146,25 +146,25 @@
146146
],
147147
"properties": {
148148
"type": {
149-
"$ref": "#/definitions/fields/type_spatial"
149+
"$ref": "#/definitions/type_spatial"
150150
},
151151
"axis": {
152-
"$ref": "#/definitions/fields/axis_xy"
152+
"$ref": "#/definitions/axis_xy"
153153
},
154154
"description": {
155-
"$ref": "#/definitions/fields/description"
155+
"$ref": "#/definitions/description"
156156
},
157157
"extent": {
158-
"$ref": "#/definitions/fields/extent_closed"
158+
"$ref": "#/definitions/extent_closed"
159159
},
160160
"values": {
161-
"$ref": "#/definitions/fields/values_numeric"
161+
"$ref": "#/definitions/values_numeric"
162162
},
163163
"step": {
164-
"$ref": "#/definitions/fields/step"
164+
"$ref": "#/definitions/step"
165165
},
166166
"reference_system": {
167-
"$ref": "#/definitions/fields/reference_system_spatial"
167+
"$ref": "#/definitions/reference_system_spatial"
168168
}
169169
}
170170
},
@@ -189,28 +189,28 @@
189189
],
190190
"properties": {
191191
"type": {
192-
"$ref": "#/definitions/fields/type_spatial"
192+
"$ref": "#/definitions/type_spatial"
193193
},
194194
"axis": {
195-
"$ref": "#/definitions/fields/axis_z"
195+
"$ref": "#/definitions/axis_z"
196196
},
197197
"description": {
198-
"$ref": "#/definitions/fields/description"
198+
"$ref": "#/definitions/description"
199199
},
200200
"extent": {
201-
"$ref": "#/definitions/fields/extent_open"
201+
"$ref": "#/definitions/extent_open"
202202
},
203203
"values": {
204-
"$ref": "#/definitions/fields/values"
204+
"$ref": "#/definitions/values"
205205
},
206206
"step": {
207-
"$ref": "#/definitions/fields/step"
207+
"$ref": "#/definitions/step"
208208
},
209209
"unit": {
210-
"$ref": "#/definitions/fields/unit"
210+
"$ref": "#/definitions/unit"
211211
},
212212
"reference_system": {
213-
"$ref": "#/definitions/fields/reference_system_spatial"
213+
"$ref": "#/definitions/reference_system_spatial"
214214
}
215215
}
216216
},
@@ -230,7 +230,7 @@
230230
"const": "temporal"
231231
},
232232
"description": {
233-
"$ref": "#/definitions/fields/description"
233+
"$ref": "#/definitions/description"
234234
},
235235
"values": {
236236
"type": "array",
@@ -259,82 +259,80 @@
259259
}
260260
}
261261
},
262-
"fields": {
263-
"type_spatial": {
264-
"type": "string",
265-
"const": "spatial"
266-
},
267-
"axis_xy": {
268-
"type": "string",
269-
"enum": [
270-
"x",
271-
"y"
272-
]
273-
},
274-
"axis_z": {
275-
"type": "string",
276-
"const": "z"
277-
},
278-
"extent_closed": {
279-
"type": "array",
280-
"minItems": 2,
281-
"maxItems": 2,
282-
"items": {
283-
"type": "number"
284-
}
285-
},
286-
"extent_open": {
287-
"type": "array",
288-
"minItems": 2,
289-
"maxItems": 2,
290-
"items": {
291-
"type": [
292-
"number",
293-
"null"
294-
]
295-
}
296-
},
297-
"values_numeric": {
298-
"type": "array",
299-
"minItems": 1,
300-
"items": {
301-
"type": "number"
302-
}
303-
},
304-
"values": {
305-
"type": "array",
306-
"minItems": 1,
307-
"items": {
308-
"oneOf": [
309-
{
310-
"type": "number"
311-
},
312-
{
313-
"type": "string"
314-
}
315-
]
316-
}
317-
},
318-
"step": {
262+
"type_spatial": {
263+
"type": "string",
264+
"const": "spatial"
265+
},
266+
"axis_xy": {
267+
"type": "string",
268+
"enum": [
269+
"x",
270+
"y"
271+
]
272+
},
273+
"axis_z": {
274+
"type": "string",
275+
"const": "z"
276+
},
277+
"extent_closed": {
278+
"type": "array",
279+
"minItems": 2,
280+
"maxItems": 2,
281+
"items": {
282+
"type": "number"
283+
}
284+
},
285+
"extent_open": {
286+
"type": "array",
287+
"minItems": 2,
288+
"maxItems": 2,
289+
"items": {
319290
"type": [
320291
"number",
321292
"null"
322293
]
323-
},
324-
"unit": {
325-
"type": "string"
326-
},
327-
"reference_system_spatial": {
328-
"type": [
329-
"string",
330-
"number",
331-
"object"
332-
],
333-
"default": 4326
334-
},
335-
"description": {
336-
"type": "string"
337294
}
295+
},
296+
"values_numeric": {
297+
"type": "array",
298+
"minItems": 1,
299+
"items": {
300+
"type": "number"
301+
}
302+
},
303+
"values": {
304+
"type": "array",
305+
"minItems": 1,
306+
"items": {
307+
"oneOf": [
308+
{
309+
"type": "number"
310+
},
311+
{
312+
"type": "string"
313+
}
314+
]
315+
}
316+
},
317+
"step": {
318+
"type": [
319+
"number",
320+
"null"
321+
]
322+
},
323+
"unit": {
324+
"type": "string"
325+
},
326+
"reference_system_spatial": {
327+
"type": [
328+
"string",
329+
"number",
330+
"object"
331+
],
332+
"default": 4326
333+
},
334+
"description": {
335+
"type": "string"
338336
}
339337
}
340338
}

extensions/single-file-stac/json-schema/schema.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"description": "Single File STAC Extension to combine Collections and Items in single file catalog",
66
"allOf": [
77
{
8-
"$ref": "../../catalog-spec/json-schema/catalog.json"
8+
"$ref": "../../../catalog-spec/json-schema/catalog.json"
99
},
1010
{
1111
"$ref": "https://geojson.org/schema/FeatureCollection.json"
@@ -31,13 +31,13 @@
3131
"collections": {
3232
"type": "array",
3333
"items": {
34-
"$ref": "../../collection-spec/json-schema/collection.json"
34+
"$ref": "../../../collection-spec/json-schema/collection.json"
3535
}
3636
},
3737
"features": {
3838
"type": "array",
3939
"items": {
40-
"$ref": "../../item-spec/json-schema/item.json"
40+
"$ref": "../../../item-spec/json-schema/item.json"
4141
}
4242
}
4343
}

item-spec/json-schema/datetime.json

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "http://json-schema.org/draft-07/schema#",
3-
"$id": "schema.json#",
3+
"$id": "datetime.json#",
44
"title": "Date and Time Fields",
55
"type": "object",
66
"allOf": [
@@ -22,7 +22,7 @@
2222
],
2323
"properties": {
2424
"datetime": {
25-
"$ref": "#/definitions/datetime_string"
25+
"$ref": "#/definitions/datetime"
2626
},
2727
"start_datetime": {
2828
"$ref": "#/definitions/start_datetime"
@@ -54,7 +54,7 @@
5454
"datetime": {
5555
"oneOf": [
5656
{
57-
"$ref": "#/definitions/datetime_string"
57+
"$ref": "#/definitions/datetime"
5858
},
5959
{
6060
"type": ["null"],
@@ -74,6 +74,24 @@
7474
}
7575
],
7676
"definitions": {
77+
"datetime": {
78+
"title": "Date and Time",
79+
"description": "The searchable date/time of the assets, in UTC (Formatted in RFC 3339) ",
80+
"type": "string",
81+
"format": "date-time"
82+
},
83+
"start_datetime": {
84+
"title": "Start Date and Time",
85+
"description": "The searchable start date/time of the assets, in UTC (Formatted in RFC 3339) ",
86+
"type": "string",
87+
"format": "date-time"
88+
},
89+
"end_datetime": {
90+
"title": "End Date and Time",
91+
"description": "The searchable end date/time of the assets, in UTC (Formatted in RFC 3339) ",
92+
"type": "string",
93+
"format": "date-time"
94+
},
7795
"created": {
7896
"title": "Creation Time",
7997
"type": "string",

item-spec/json-schema/instrument.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,6 @@
2626
"gsd": {
2727
"title": "Ground Sample Distance",
2828
"type": "number"
29-
},
29+
}
3030
}
3131
}

item-spec/json-schema/item.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"title": "STAC Item",
55
"type": "object",
66
"description": "This object represents the metadata for an item in a SpatioTemporal Asset Catalog.",
7-
"additionalProperties": true,
87
"allOf": [
98
{
109
"$ref": "#/definitions/core"

0 commit comments

Comments
 (0)