diff --git a/CHANGELOG.md b/CHANGELOG.md index 5aaeddb..e52e51c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed invalid examples +- JSON Schema checks `label:assets` in links ## [v1.0.0] - 2021-03-8 diff --git a/examples/multidataset/spacenet-buildings/AOI_2_Vegas_img2636.json b/examples/multidataset/spacenet-buildings/AOI_2_Vegas_img2636.json index f8d2de7..53f851f 100644 --- a/examples/multidataset/spacenet-buildings/AOI_2_Vegas_img2636.json +++ b/examples/multidataset/spacenet-buildings/AOI_2_Vegas_img2636.json @@ -99,7 +99,9 @@ "rel": "source", "href": "https://spacenet-dataset.s3.amazonaws.com/spacenet/SN2_buildings/train/AOI_2_Vegas/PS-RGB/SN2_buildings_train_AOI_2_Vegas_PS-RGB_img2636.tif", "title": "The source imagery these building labels were derived from", - "label:assets": "OBJECTID_1" + "label:assets": [ + "OBJECTID_1" + ] } ] } \ No newline at end of file diff --git a/examples/multidataset/spacenet-buildings/AOI_3_Paris_img1648.json b/examples/multidataset/spacenet-buildings/AOI_3_Paris_img1648.json index 9c29791..f24fec6 100644 --- a/examples/multidataset/spacenet-buildings/AOI_3_Paris_img1648.json +++ b/examples/multidataset/spacenet-buildings/AOI_3_Paris_img1648.json @@ -99,7 +99,9 @@ "rel": "source", "href": "https://spacenet-dataset.s3.amazonaws.com/spacenet/SN2_buildings/train/AOI_3_Paris/PS-RGB/SN2_buildings_train_AOI_3_Paris_PS-RGB_img1648.tif", "title": "The source imagery these building labels were derived from", - "label:assets": "OBJECTID_1" + "label:assets": [ + "OBJECTID_1" + ] } ] } \ No newline at end of file diff --git a/examples/multidataset/spacenet-buildings/AOI_4_Shanghai_img3344.json b/examples/multidataset/spacenet-buildings/AOI_4_Shanghai_img3344.json index c7b38cf..0a2f2a3 100644 --- a/examples/multidataset/spacenet-buildings/AOI_4_Shanghai_img3344.json +++ b/examples/multidataset/spacenet-buildings/AOI_4_Shanghai_img3344.json @@ -99,7 +99,9 @@ "rel": "source", "href": "https://spacenet-dataset.s3.amazonaws.com/spacenet/SN2_buildings/train/AOI_4_Shanghai/PS-RGB/SN2_buildings_train_AOI_4_Shanghai_PS-RGB_img3344.tif", "title": "The source imagery these building labels were derived from", - "label:assets": "OBJECTID_1" + "label:assets": [ + "OBJECTID_1" + ] } ] } \ No newline at end of file diff --git a/examples/multidataset/zanzibar/znz001.json b/examples/multidataset/zanzibar/znz001.json index 04cd42a..4c99e06 100644 --- a/examples/multidataset/zanzibar/znz001.json +++ b/examples/multidataset/zanzibar/znz001.json @@ -113,7 +113,9 @@ "rel": "source", "href": "https://oin-hotosm.s3.amazonaws.com/5afeda152b6a08001185f11a/0/5afeda152b6a08001185f11b.tif", "title": "The source imagery these building labels were derived from", - "label:assets": "building" + "label:assets": [ + "building" + ] } ] } \ No newline at end of file diff --git a/examples/multidataset/zanzibar/znz029.json b/examples/multidataset/zanzibar/znz029.json index ea6e5d4..011701c 100644 --- a/examples/multidataset/zanzibar/znz029.json +++ b/examples/multidataset/zanzibar/znz029.json @@ -113,7 +113,9 @@ "rel": "source", "href": "https://oin-hotosm.s3.amazonaws.com/5ae242fd0b093000130afd38/0/5ae242fd0b093000130afd39.tif", "title": "The source imagery these building labels were derived from", - "label:assets": "building" + "label:assets": [ + "building" + ] } ] } \ No newline at end of file diff --git a/examples/spacenet-roads/roads_item.json b/examples/spacenet-roads/roads_item.json index 7f9cffe..ca51e2f 100644 --- a/examples/spacenet-roads/roads_item.json +++ b/examples/spacenet-roads/roads_item.json @@ -156,7 +156,9 @@ "href": "roads_source.json", "rel": "source", "title": "The source imagery these road labels were derived from", - "label:assets": "road_labels" + "label:assets": [ + "road_labels" + ] } ], "assets": { diff --git a/json-schema/schema.json b/json-schema/schema.json index ec79e1f..1184716 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -12,6 +12,7 @@ "required": [ "type", "properties", + "links", "assets" ], "properties": { @@ -33,6 +34,12 @@ } ] }, + "links": { + "type": "array", + "items": { + "$ref": "#/definitions/link_fields" + } + }, "assets": { "type": "object", "additionalProperties": { @@ -73,11 +80,7 @@ } }, { - "$comment": "Remove this and the following object if this is not an extension to a Collection.", "$ref": "#/definitions/stac_extensions" - }, - { - "$ref": "#/definitions/fields" } ] } @@ -97,6 +100,21 @@ } } }, + "link_fields": { + "type": "object", + "properties": { + "label:assets": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "patternProperties": { + "^(?!label:)": {} + }, + "additionalProperties": false + }, "fields": { "type": "object", "properties": { @@ -223,9 +241,7 @@ } }, "patternProperties": { - "^(?!label:)": { - "$comment": "Above, change `template` to the prefix of this extension" - } + "^(?!label:)": {} }, "additionalProperties": false }