From dd13e34141bdd768e0e0c3020ed4cf7f055b48ab Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Thu, 16 Nov 2023 09:13:28 +0100 Subject: [PATCH 1/5] pre-commit-config: do not reformat schemas Reformatting will give spurious differences after running the update.sh script. --- .pre-commit-config.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 678ef6761..fff9edba7 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -49,18 +49,20 @@ repos: - id: check-docstring-first # Avoid common error of code before docstring. - id: check-json # Check json file syntax # (Exclude Typescript config: it uses json5 extensions) - exclude: 'tsconfig.json' + exclude: 'tsconfig.json|^integration_tests/schemas/' - id: check-merge-conflict # Don't commit merge-conflicts - id: check-symlinks # Symlinks that don't point to anything? - id: check-yaml # Check Yaml file syntax args: [--allow-multiple-documents] - id: debug-statements # Avoid commiting debug/breakpoints - id: end-of-file-fixer # Normalise on exactly one newline + exclude: '^integration_tests/schemas/' - id: fix-byte-order-marker # No UTF-8 byte order marks - id: mixed-line-ending # Don't allow mixed line endings - id: pretty-format-json args: ['--no-sort-keys', '--indent=4', '--autofix'] # (Exclude Typescript config: it uses json5 extensions) - exclude: 'tsconfig.json' + exclude: 'tsconfig.json|^integration_tests/schemas/' - id: requirements-txt-fixer # Keep requirements files sorted. - id: trailing-whitespace # Auto remove trailing whitespace + exclude: '^integration_tests/schemas/' From aa34b27e0dbf196837b4f0e7d08e5675a2e8783b Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Sun, 19 Nov 2023 13:26:58 +0100 Subject: [PATCH 2/5] schemas/update.sh: auto-update STAC version Make the update script fix the STAC version instead of having a comment inside the test file. --- integration_tests/schemas/update.sh | 1 + integration_tests/test_stac.py | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/integration_tests/schemas/update.sh b/integration_tests/schemas/update.sh index ebc6531ba..b2faff78f 100755 --- a/integration_tests/schemas/update.sh +++ b/integration_tests/schemas/update.sh @@ -44,6 +44,7 @@ ln -s "../schemas.stacspec.org/${stac_api_tag}" "stac-api/" # The ItemCollection was removed from core stac, but is used by stac-api. cd "stac/${stac_version}/item-spec/json-schema" wget https://raw.githubusercontent.com/radiantearth/stac-spec/568a04821935cc92de7b4b05ea6fa9f6bf8a0592/item-spec/json-schema/itemcollection.json +perl -pi -e 's#"const": "0.9.0"#"const": "1.0.0"#g' itemcollection.json echo "Success" echo "If git status shows any changes, rerun tests, and commit them" diff --git a/integration_tests/test_stac.py b/integration_tests/test_stac.py index dd5d15a88..2c6829b02 100644 --- a/integration_tests/test_stac.py +++ b/integration_tests/test_stac.py @@ -200,7 +200,6 @@ def load_schema_doc( # Run `./update.sh` in the schema dir to check for newer versions of these. -# NOTE: you will need to manually update the stac version for the itemcollection schema. _CATALOG_SCHEMA = load_validator( _STAC_SCHEMA_BASE / "catalog-spec/json-schema/catalog.json" ) From ce66967488ad78402820acc6f9ebe229dfd87e7d Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Thu, 16 Nov 2023 08:38:08 +0100 Subject: [PATCH 3/5] schema/update.sh: use stac-api-spec v1.0.0 --- integration_tests/schemas/update.sh | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/integration_tests/schemas/update.sh b/integration_tests/schemas/update.sh index b2faff78f..fa72a2297 100755 --- a/integration_tests/schemas/update.sh +++ b/integration_tests/schemas/update.sh @@ -4,7 +4,7 @@ set -eu stac_tag='v1.0.0' -stac_api_tag='master' +stac_api_tag='v1.0.0' function get() { @@ -19,27 +19,30 @@ get 'http://geojson.org/schema/Feature.json' # strip the 'v' from the start if there. stac_version="${stac_tag#v}" +stac_api_version="${stac_api_tag#v}" subfolder="stac-spec-${stac_version}" set -x +# Clean before updating. +rm -rf schemas.stacspec.org +mkdir schemas.stacspec.org + wget https://github.com/radiantearth/stac-spec/archive/${stac_tag}.tar.gz tar -xvf ${stac_tag}.tar.gz --wildcards "${subfolder}/*/json-schema/*.json" rm ${stac_tag}.tar.gz -rm -rf "schemas.stacspec.org/${stac_version}" mv ${subfolder} "schemas.stacspec.org/${stac_version}" -rm -rf "stac/${stac_version}" +rm -f "stac/${stac_version}" # The path to the linked folder needs to be relative to the path of the symlink. ln -s "../schemas.stacspec.org/${stac_version}" "stac/" -api_subfolder="stac-api-spec-${stac_api_tag}" -wget https://github.com/radiantearth/stac-api-spec/archive/${stac_api_tag}.tar.gz -tar -xvf ${stac_api_tag}.tar.gz --wildcards "${api_subfolder}/*/json-schema/*.json" -rm ${stac_api_tag}.tar.gz -rm -rf "schemas.stacspec.org/${stac_api_tag}" -mv ${api_subfolder} "schemas.stacspec.org/${stac_api_tag}" -rm -rf "stac-api/${stac_api_tag}" -ln -s "../schemas.stacspec.org/${stac_api_tag}" "stac-api/" +api_subfolder="stac-api-spec-${stac_api_version}" +wget -O api-${stac_api_tag}.tar.gz https://github.com/radiantearth/stac-api-spec/archive/${stac_api_tag}.tar.gz +tar -xvf api-${stac_api_tag}.tar.gz --wildcards "${api_subfolder}/*/json-schema/*.json" +rm api-${stac_api_tag}.tar.gz +mv ${api_subfolder}/stac-spec "schemas.stacspec.org/${stac_api_version}" +rm -f "stac-api/${stac_api_version}" +ln -s "../schemas.stacspec.org/${stac_api_version}" "stac-api/" # The ItemCollection was removed from core stac, but is used by stac-api. cd "stac/${stac_version}/item-spec/json-schema" From 75046284fab4d0a08c576cc63b17fb677fb8f283 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Thu, 16 Nov 2023 10:29:39 +0100 Subject: [PATCH 4/5] schemas: update to stac-api 1.0.0 This effectively renames the directory called master to 1.0.0. --- .../schemas/geojson.org/schema/Feature.json | 876 ++++++++-------- .../geojson.org/schema/FeatureCollection.json | 990 +++++++++--------- .../schemas/geojson.org/schema/Geometry.json | 408 ++++---- .../catalog-spec/json-schema/catalog.json | 176 ++-- .../json-schema/collection.json | 498 ++++----- .../1.0.0/item-spec/json-schema/basics.json | 32 +- .../1.0.0/item-spec/json-schema/datetime.json | 103 +- .../item-spec/json-schema/instrument.json | 60 +- .../1.0.0/item-spec/json-schema/item.json | 496 ++++----- .../item-spec/json-schema/itemcollection.json | 152 +-- .../item-spec/json-schema/licensing.json | 20 +- .../1.0.0/item-spec/json-schema/provider.json | 82 +- .../catalog-spec/json-schema/catalog.json | 94 ++ .../json-schema/collection.json | 270 +++++ .../item-spec/json-schema/basics.json | 18 + .../item-spec/json-schema/datetime.json | 53 + .../item-spec/json-schema/instrument.json | 32 + .../stac-spec/item-spec/json-schema/item.json | 272 +++++ .../item-spec/json-schema/licensing.json | 12 + .../item-spec/json-schema/provider.json | 47 + .../fragments/context/json-schema/schema.json | 45 - .../catalog-spec/json-schema/catalog.json | 94 -- .../json-schema/collection.json | 270 ----- .../item-spec/json-schema/basics.json | 18 - .../item-spec/json-schema/datetime.json | 56 - .../item-spec/json-schema/instrument.json | 32 - .../stac-spec/item-spec/json-schema/item.json | 272 ----- .../item-spec/json-schema/licensing.json | 12 - .../item-spec/json-schema/provider.json | 47 - integration_tests/schemas/stac-api/1.0.0 | 1 + integration_tests/schemas/stac-api/master | 1 - 31 files changed, 2744 insertions(+), 2795 deletions(-) create mode 100644 integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/catalog-spec/json-schema/catalog.json create mode 100644 integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/collection-spec/json-schema/collection.json create mode 100644 integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/basics.json create mode 100644 integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/datetime.json create mode 100644 integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/instrument.json create mode 100644 integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/item.json create mode 100644 integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/licensing.json create mode 100644 integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/provider.json delete mode 100644 integration_tests/schemas/schemas.stacspec.org/master/fragments/context/json-schema/schema.json delete mode 100644 integration_tests/schemas/schemas.stacspec.org/master/stac-spec/catalog-spec/json-schema/catalog.json delete mode 100644 integration_tests/schemas/schemas.stacspec.org/master/stac-spec/collection-spec/json-schema/collection.json delete mode 100644 integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/basics.json delete mode 100644 integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/datetime.json delete mode 100644 integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/instrument.json delete mode 100644 integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/item.json delete mode 100644 integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/licensing.json delete mode 100644 integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/provider.json create mode 120000 integration_tests/schemas/stac-api/1.0.0 delete mode 120000 integration_tests/schemas/stac-api/master diff --git a/integration_tests/schemas/geojson.org/schema/Feature.json b/integration_tests/schemas/geojson.org/schema/Feature.json index 808939722..30151f53a 100644 --- a/integration_tests/schemas/geojson.org/schema/Feature.json +++ b/integration_tests/schemas/geojson.org/schema/Feature.json @@ -1,505 +1,505 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://geojson.org/schema/Feature.json", - "title": "GeoJSON Feature", - "type": "object", - "required": [ - "type", - "properties", - "geometry" - ], + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://geojson.org/schema/Feature.json", + "title": "GeoJSON Feature", + "type": "object", + "required": [ + "type", + "properties", + "geometry" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Feature" + ] + }, + "id": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ] + }, "properties": { - "type": { - "type": "string", - "enum": [ - "Feature" - ] + "oneOf": [ + { + "type": "null" + }, + { + "type": "object" + } + ] + }, + "geometry": { + "oneOf": [ + { + "type": "null" + }, + { + "title": "GeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Point" + ] + }, + "coordinates": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "LineString" + ] + }, + "coordinates": { + "type": "array", + "minItems": 2, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } }, - "id": { - "oneOf": [ - { + { + "title": "GeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Polygon" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { "type": "number" - }, - { - "type": "string" + } + } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MultiPoint" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" } - ] + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MultiLineString" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } }, - "properties": { - "oneOf": [ - { - "type": "null" - }, - { - "type": "object" + { + "title": "GeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MultiPolygon" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } } - ] + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } }, - "geometry": { - "oneOf": [ - { - "type": "null" - }, - { + { + "title": "GeoJSON GeometryCollection", + "type": "object", + "required": [ + "type", + "geometries" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "GeometryCollection" + ] + }, + "geometries": { + "type": "array", + "items": { + "oneOf": [ + { "title": "GeoJSON Point", "type": "object", "required": [ - "type", - "coordinates" + "type", + "coordinates" ], "properties": { - "type": { - "type": "string", - "enum": [ - "Point" - ] - }, - "coordinates": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } + "type": { + "type": "string", + "enum": [ + "Point" + ] + }, + "coordinates": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } } - }, - { + }, + { "title": "GeoJSON LineString", "type": "object", "required": [ - "type", - "coordinates" + "type", + "coordinates" ], "properties": { - "type": { - "type": "string", - "enum": [ - "LineString" - ] - }, - "coordinates": { - "type": "array", - "minItems": 2, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } + "type": { + "type": "string", + "enum": [ + "LineString" + ] + }, + "coordinates": { + "type": "array", + "minItems": 2, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" } + } } - }, - { + }, + { "title": "GeoJSON Polygon", "type": "object", "required": [ - "type", - "coordinates" + "type", + "coordinates" ], "properties": { - "type": { - "type": "string", - "enum": [ - "Polygon" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 4, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - }, - "bbox": { + "type": { + "type": "string", + "enum": [ + "Polygon" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { "type": "array", - "minItems": 4, + "minItems": 2, "items": { - "type": "number" + "type": "number" } + } } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } } - }, - { + }, + { "title": "GeoJSON MultiPoint", "type": "object", "required": [ - "type", - "coordinates" + "type", + "coordinates" ], "properties": { - "type": { - "type": "string", - "enum": [ - "MultiPoint" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } + "type": { + "type": "string", + "enum": [ + "MultiPoint" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" } + } } - }, - { + }, + { "title": "GeoJSON MultiLineString", "type": "object", "required": [ - "type", - "coordinates" + "type", + "coordinates" ], "properties": { - "type": { - "type": "string", - "enum": [ - "MultiLineString" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - }, - "bbox": { + "type": { + "type": "string", + "enum": [ + "MultiLineString" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "items": { "type": "array", - "minItems": 4, + "minItems": 2, "items": { - "type": "number" + "type": "number" } + } } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } } - }, - { + }, + { "title": "GeoJSON MultiPolygon", "type": "object", "required": [ - "type", - "coordinates" + "type", + "coordinates" ], "properties": { - "type": { - "type": "string", - "enum": [ - "MultiPolygon" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "array", - "minItems": 4, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - } - }, - "bbox": { + "type": { + "type": "string", + "enum": [ + "MultiPolygon" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { "type": "array", "minItems": 4, "items": { + "type": "array", + "minItems": 2, + "items": { "type": "number" + } } + } } - } - }, - { - "title": "GeoJSON GeometryCollection", - "type": "object", - "required": [ - "type", - "geometries" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "GeometryCollection" - ] - }, - "geometries": { - "type": "array", - "items": { - "oneOf": [ - { - "title": "GeoJSON Point", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Point" - ] - }, - "coordinates": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } - }, - { - "title": "GeoJSON LineString", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "LineString" - ] - }, - "coordinates": { - "type": "array", - "minItems": 2, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } - }, - { - "title": "GeoJSON Polygon", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Polygon" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 4, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } - }, - { - "title": "GeoJSON MultiPoint", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "MultiPoint" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } - }, - { - "title": "GeoJSON MultiLineString", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "MultiLineString" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } - }, - { - "title": "GeoJSON MultiPolygon", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "MultiPolygon" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "array", - "minItems": 4, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } - } - ] - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" } + } } - } - ] - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { + } + ] + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { "type": "number" + } } + } } + ] + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } } + } } diff --git a/integration_tests/schemas/geojson.org/schema/FeatureCollection.json b/integration_tests/schemas/geojson.org/schema/FeatureCollection.json index 87b56c70e..c8d4e1b3b 100644 --- a/integration_tests/schemas/geojson.org/schema/FeatureCollection.json +++ b/integration_tests/schemas/geojson.org/schema/FeatureCollection.json @@ -1,531 +1,531 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://geojson.org/schema/FeatureCollection.json", - "title": "GeoJSON FeatureCollection", - "type": "object", - "required": [ - "type", - "features" - ], - "properties": { - "type": { + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://geojson.org/schema/FeatureCollection.json", + "title": "GeoJSON FeatureCollection", + "type": "object", + "required": [ + "type", + "features" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "FeatureCollection" + ] + }, + "features": { + "type": "array", + "items": { + "title": "GeoJSON Feature", + "type": "object", + "required": [ + "type", + "properties", + "geometry" + ], + "properties": { + "type": { "type": "string", "enum": [ - "FeatureCollection" + "Feature" ] - }, - "features": { - "type": "array", - "items": { - "title": "GeoJSON Feature", + }, + "id": { + "oneOf": [ + { + "type": "number" + }, + { + "type": "string" + } + ] + }, + "properties": { + "oneOf": [ + { + "type": "null" + }, + { + "type": "object" + } + ] + }, + "geometry": { + "oneOf": [ + { + "type": "null" + }, + { + "title": "GeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Point" + ] + }, + "coordinates": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "LineString" + ] + }, + "coordinates": { + "type": "array", + "minItems": 2, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Polygon" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MultiPoint" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MultiLineString" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MultiPolygon" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON GeometryCollection", "type": "object", "required": [ - "type", - "properties", - "geometry" + "type", + "geometries" ], "properties": { - "type": { - "type": "string", - "enum": [ - "Feature" - ] - }, - "id": { - "oneOf": [ - { + "type": { + "type": "string", + "enum": [ + "GeometryCollection" + ] + }, + "geometries": { + "type": "array", + "items": { + "oneOf": [ + { + "title": "GeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Point" + ] + }, + "coordinates": { + "type": "array", + "minItems": 2, + "items": { "type": "number" + } }, - { - "type": "string" + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } } - ] - }, - "properties": { - "oneOf": [ - { - "type": "null" + } + }, + { + "title": "GeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "LineString" + ] }, - { - "type": "object" + "coordinates": { + "type": "array", + "minItems": 2, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } } - ] - }, - "geometry": { - "oneOf": [ - { - "type": "null" + } + }, + { + "title": "GeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Polygon" + ] }, - { - "title": "GeoJSON Point", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Point" - ] - }, - "coordinates": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } } + } }, - { - "title": "GeoJSON LineString", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "LineString" - ] - }, - "coordinates": { - "type": "array", - "minItems": 2, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MultiPoint" + ] }, - { - "title": "GeoJSON Polygon", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Polygon" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 4, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" } + } }, - { - "title": "GeoJSON MultiPoint", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "MultiPoint" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MultiLineString" + ] }, - { - "title": "GeoJSON MultiLineString", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "MultiLineString" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } } + } }, - { - "title": "GeoJSON MultiPolygon", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "MultiPolygon" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "array", - "minItems": 4, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MultiPolygon" + ] }, - { - "title": "GeoJSON GeometryCollection", - "type": "object", - "required": [ - "type", - "geometries" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "GeometryCollection" - ] - }, - "geometries": { - "type": "array", - "items": { - "oneOf": [ - { - "title": "GeoJSON Point", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Point" - ] - }, - "coordinates": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } - }, - { - "title": "GeoJSON LineString", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "LineString" - ] - }, - "coordinates": { - "type": "array", - "minItems": 2, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } - }, - { - "title": "GeoJSON Polygon", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Polygon" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 4, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } - }, - { - "title": "GeoJSON MultiPoint", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "MultiPoint" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } - }, - { - "title": "GeoJSON MultiLineString", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "MultiLineString" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } - }, - { - "title": "GeoJSON MultiPolygon", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "MultiPolygon" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "array", - "minItems": 4, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } - } - ] - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" } + } } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } } - ] - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" + } } + ] + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" } + } } - } - }, - "bbox": { + } + ] + }, + "bbox": { "type": "array", "minItems": 4, "items": { - "type": "number" + "type": "number" } + } } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } } + } } diff --git a/integration_tests/schemas/geojson.org/schema/Geometry.json b/integration_tests/schemas/geojson.org/schema/Geometry.json index 790f12b2a..de567162d 100644 --- a/integration_tests/schemas/geojson.org/schema/Geometry.json +++ b/integration_tests/schemas/geojson.org/schema/Geometry.json @@ -1,218 +1,218 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://geojson.org/schema/Geometry.json", - "title": "GeoJSON Geometry", - "oneOf": [ - { - "title": "GeoJSON Point", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Point" - ] - }, - "coordinates": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } - } + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://geojson.org/schema/Geometry.json", + "title": "GeoJSON Geometry", + "oneOf": [ + { + "title": "GeoJSON Point", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Point" + ] }, - { - "title": "GeoJSON LineString", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "LineString" - ] - }, - "coordinates": { - "type": "array", - "minItems": 2, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } + "coordinates": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON LineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "LineString" + ] + }, + "coordinates": { + "type": "array", + "minItems": 2, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" } + } }, - { - "title": "GeoJSON Polygon", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "Polygon" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 4, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON Polygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "Polygon" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } } + } }, - { - "title": "GeoJSON MultiPoint", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "MultiPoint" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPoint", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MultiPoint" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" } + } }, - { - "title": "GeoJSON MultiLineString", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "MultiLineString" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } - } + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiLineString", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MultiLineString" + ] + }, + "coordinates": { + "type": "array", + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" + } } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } + } + } + }, + { + "title": "GeoJSON MultiPolygon", + "type": "object", + "required": [ + "type", + "coordinates" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "MultiPolygon" + ] }, - { - "title": "GeoJSON MultiPolygon", - "type": "object", - "required": [ - "type", - "coordinates" - ], - "properties": { - "type": { - "type": "string", - "enum": [ - "MultiPolygon" - ] - }, - "coordinates": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "array", - "minItems": 4, - "items": { - "type": "array", - "minItems": 2, - "items": { - "type": "number" - } - } - } - } - }, - "bbox": { - "type": "array", - "minItems": 4, - "items": { - "type": "number" - } + "coordinates": { + "type": "array", + "items": { + "type": "array", + "items": { + "type": "array", + "minItems": 4, + "items": { + "type": "array", + "minItems": 2, + "items": { + "type": "number" } + } } + } + }, + "bbox": { + "type": "array", + "minItems": 4, + "items": { + "type": "number" + } } - ] + } + } + ] } diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/catalog-spec/json-schema/catalog.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/catalog-spec/json-schema/catalog.json index 370d4db06..31b2c8f8a 100644 --- a/integration_tests/schemas/schemas.stacspec.org/1.0.0/catalog-spec/json-schema/catalog.json +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/catalog-spec/json-schema/catalog.json @@ -1,94 +1,94 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/catalog-spec/json-schema/catalog.json#", - "title": "STAC Catalog Specification", - "description": "This object represents Catalogs in a SpatioTemporal Asset Catalog.", - "allOf": [ - { - "$ref": "#/definitions/catalog" + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/catalog-spec/json-schema/catalog.json#", + "title": "STAC Catalog Specification", + "description": "This object represents Catalogs in a SpatioTemporal Asset Catalog.", + "allOf": [ + { + "$ref": "#/definitions/catalog" + } + ], + "definitions": { + "catalog": { + "title": "STAC Catalog", + "type": "object", + "required": [ + "stac_version", + "type", + "id", + "description", + "links" + ], + "properties": { + "stac_version": { + "title": "STAC version", + "type": "string", + "const": "1.0.0" + }, + "stac_extensions": { + "title": "STAC extensions", + "type": "array", + "uniqueItems": true, + "items": { + "title": "Reference to a JSON Schema", + "type": "string", + "format": "iri" + } + }, + "type": { + "title": "Type of STAC entity", + "const": "Catalog" + }, + "id": { + "title": "Identifier", + "type": "string", + "minLength": 1 + }, + "title": { + "title": "Title", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string", + "minLength": 1 + }, + "links": { + "title": "Links", + "type": "array", + "items": { + "$ref": "#/definitions/link" + } } - ], - "definitions": { - "catalog": { - "title": "STAC Catalog", - "type": "object", - "required": [ - "stac_version", - "type", - "id", - "description", - "links" - ], - "properties": { - "stac_version": { - "title": "STAC version", - "type": "string", - "const": "1.0.0" - }, - "stac_extensions": { - "title": "STAC extensions", - "type": "array", - "uniqueItems": true, - "items": { - "title": "Reference to a JSON Schema", - "type": "string", - "format": "iri" - } - }, - "type": { - "title": "Type of STAC entity", - "const": "Catalog" - }, - "id": { - "title": "Identifier", - "type": "string", - "minLength": 1 - }, - "title": { - "title": "Title", - "type": "string" - }, - "description": { - "title": "Description", - "type": "string", - "minLength": 1 - }, - "links": { - "title": "Links", - "type": "array", - "items": { - "$ref": "#/definitions/link" - } - } - } + } + }, + "link": { + "type": "object", + "required": [ + "rel", + "href" + ], + "properties": { + "href": { + "title": "Link reference", + "type": "string", + "format": "iri-reference", + "minLength": 1 + }, + "rel": { + "title": "Link relation type", + "type": "string", + "minLength": 1 + }, + "type": { + "title": "Link type", + "type": "string" }, - "link": { - "type": "object", - "required": [ - "rel", - "href" - ], - "properties": { - "href": { - "title": "Link reference", - "type": "string", - "format": "iri-reference", - "minLength": 1 - }, - "rel": { - "title": "Link relation type", - "type": "string", - "minLength": 1 - }, - "type": { - "title": "Link type", - "type": "string" - }, - "title": { - "title": "Link title", - "type": "string" - } - } + "title": { + "title": "Link title", + "type": "string" } + } } + } } diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/collection-spec/json-schema/collection.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/collection-spec/json-schema/collection.json index 3dc1fab00..2ad20902d 100644 --- a/integration_tests/schemas/schemas.stacspec.org/1.0.0/collection-spec/json-schema/collection.json +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/collection-spec/json-schema/collection.json @@ -1,270 +1,270 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json#", - "title": "STAC Collection Specification", - "description": "This object represents Collections in a SpatioTemporal Asset Catalog.", - "allOf": [ - { - "$ref": "#/definitions/collection" - } - ], - "definitions": { - "collection": { - "title": "STAC Collection", - "description": "These are the fields specific to a STAC Collection. All other fields are inherited from STAC Catalog.", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json#", + "title": "STAC Collection Specification", + "description": "This object represents Collections in a SpatioTemporal Asset Catalog.", + "allOf": [ + { + "$ref": "#/definitions/collection" + } + ], + "definitions": { + "collection": { + "title": "STAC Collection", + "description": "These are the fields specific to a STAC Collection. All other fields are inherited from STAC Catalog.", + "type": "object", + "required": [ + "stac_version", + "type", + "id", + "description", + "license", + "extent", + "links" + ], + "properties": { + "stac_version": { + "title": "STAC version", + "type": "string", + "const": "1.0.0" + }, + "stac_extensions": { + "title": "STAC extensions", + "type": "array", + "uniqueItems": true, + "items": { + "title": "Reference to a JSON Schema", + "type": "string", + "format": "iri" + } + }, + "type": { + "title": "Type of STAC entity", + "const": "Collection" + }, + "id": { + "title": "Identifier", + "type": "string", + "minLength": 1 + }, + "title": { + "title": "Title", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string", + "minLength": 1 + }, + "keywords": { + "title": "Keywords", + "type": "array", + "items": { + "type": "string" + } + }, + "license": { + "title": "Collection License Name", + "type": "string", + "pattern": "^[\\w\\-\\.\\+]+$" + }, + "providers": { + "type": "array", + "items": { "type": "object", "required": [ - "stac_version", - "type", - "id", - "description", - "license", - "extent", - "links" + "name" ], "properties": { - "stac_version": { - "title": "STAC version", - "type": "string", - "const": "1.0.0" - }, - "stac_extensions": { - "title": "STAC extensions", - "type": "array", - "uniqueItems": true, - "items": { - "title": "Reference to a JSON Schema", - "type": "string", - "format": "iri" - } - }, - "type": { - "title": "Type of STAC entity", - "const": "Collection" - }, - "id": { - "title": "Identifier", - "type": "string", - "minLength": 1 - }, - "title": { - "title": "Title", - "type": "string" - }, - "description": { - "title": "Description", - "type": "string", - "minLength": 1 - }, - "keywords": { - "title": "Keywords", - "type": "array", - "items": { - "type": "string" - } - }, - "license": { - "title": "Collection License Name", - "type": "string", - "pattern": "^[\\w\\-\\.\\+]+$" - }, - "providers": { + "name": { + "title": "Organization name", + "type": "string" + }, + "description": { + "title": "Organization description", + "type": "string" + }, + "roles": { + "title": "Organization roles", + "type": "array", + "items": { + "type": "string", + "enum": [ + "producer", + "licensor", + "processor", + "host" + ] + } + }, + "url": { + "title": "Organization homepage", + "type": "string", + "format": "iri" + } + } + } + }, + "extent": { + "title": "Extents", + "type": "object", + "required": [ + "spatial", + "temporal" + ], + "properties": { + "spatial": { + "title": "Spatial extent object", + "type": "object", + "required": [ + "bbox" + ], + "properties": { + "bbox": { + "title": "Spatial extents", + "type": "array", + "minItems": 1, + "items": { + "title": "Spatial extent", "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "title": "Organization name", - "type": "string" - }, - "description": { - "title": "Organization description", - "type": "string" - }, - "roles": { - "title": "Organization roles", - "type": "array", - "items": { - "type": "string", - "enum": [ - "producer", - "licensor", - "processor", - "host" - ] - } - }, - "url": { - "title": "Organization homepage", - "type": "string", - "format": "iri" - } - } - } - }, - "extent": { - "title": "Extents", - "type": "object", - "required": [ - "spatial", - "temporal" + "oneOf": [ + { + "minItems":4, + "maxItems":4 + }, + { + "minItems":6, + "maxItems":6 + } ], - "properties": { - "spatial": { - "title": "Spatial extent object", - "type": "object", - "required": [ - "bbox" - ], - "properties": { - "bbox": { - "title": "Spatial extents", - "type": "array", - "minItems": 1, - "items": { - "title": "Spatial extent", - "type": "array", - "oneOf": [ - { - "minItems": 4, - "maxItems": 4 - }, - { - "minItems": 6, - "maxItems": 6 - } - ], - "items": { - "type": "number" - } - } - } - } - }, - "temporal": { - "title": "Temporal extent object", - "type": "object", - "required": [ - "interval" - ], - "properties": { - "interval": { - "title": "Temporal extents", - "type": "array", - "minItems": 1, - "items": { - "title": "Temporal extent", - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": { - "type": [ - "string", - "null" - ], - "format": "date-time", - "pattern": "(\\+00:00|Z)$" - } - } - } - } - } + "items": { + "type": "number" } - }, - "assets": { - "$ref": "../../item-spec/json-schema/item.json#/definitions/assets" - }, - "links": { - "title": "Links", + } + } + } + }, + "temporal": { + "title": "Temporal extent object", + "type": "object", + "required": [ + "interval" + ], + "properties": { + "interval": { + "title": "Temporal extents", + "type": "array", + "minItems": 1, + "items": { + "title": "Temporal extent", "type": "array", + "minItems": 2, + "maxItems": 2, "items": { - "$ref": "#/definitions/link" + "type": [ + "string", + "null" + ], + "format": "date-time", + "pattern": "(\\+00:00|Z)$" } - }, - "summaries": { - "$ref": "#/definitions/summaries" + } } + } } + } + }, + "assets": { + "$ref": "../../item-spec/json-schema/item.json#/definitions/assets" + }, + "links": { + "title": "Links", + "type": "array", + "items": { + "$ref": "#/definitions/link" + } + }, + "summaries": { + "$ref": "#/definitions/summaries" + } + } + }, + "link": { + "type": "object", + "required": [ + "rel", + "href" + ], + "properties": { + "href": { + "title": "Link reference", + "type": "string", + "format": "iri-reference", + "minLength": 1 + }, + "rel": { + "title": "Link relation type", + "type": "string", + "minLength": 1 }, - "link": { + "type": { + "title": "Link type", + "type": "string" + }, + "title": { + "title": "Link title", + "type": "string" + } + } + }, + "summaries": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "title": "JSON Schema", + "type": "object", + "minProperties": 1, + "allOf": [ + { + "$ref": "http://json-schema.org/draft-07/schema" + } + ] + }, + { + "title": "Range", "type": "object", "required": [ - "rel", - "href" + "minimum", + "maximum" ], "properties": { - "href": { - "title": "Link reference", - "type": "string", - "format": "iri-reference", - "minLength": 1 - }, - "rel": { - "title": "Link relation type", - "type": "string", - "minLength": 1 - }, - "type": { - "title": "Link type", - "type": "string" - }, - "title": { - "title": "Link title", - "type": "string" - } - } - }, - "summaries": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "title": "JSON Schema", - "type": "object", - "minProperties": 1, - "allOf": [ - { - "$ref": "http://json-schema.org/draft-07/schema" - } - ] - }, - { - "title": "Range", - "type": "object", - "required": [ - "minimum", - "maximum" - ], - "properties": { - "minimum": { - "title": "Minimum value", - "type": [ - "number", - "string" - ] - }, - "maximum": { - "title": "Maximum value", - "type": [ - "number", - "string" - ] - } - } - }, - { - "title": "Set of values", - "type": "array", - "minItems": 1, - "items": { - "description": "For each field only the original data type of the property can occur (except for arrays), but we can't validate that in JSON Schema yet. See the sumamry description in the STAC specification for details." - } - } + "minimum": { + "title": "Minimum value", + "type": [ + "number", + "string" + ] + }, + "maximum": { + "title": "Maximum value", + "type": [ + "number", + "string" ] + } } - } + }, + { + "title": "Set of values", + "type": "array", + "minItems": 1, + "items": { + "description": "For each field only the original data type of the property can occur (except for arrays), but we can't validate that in JSON Schema yet. See the sumamry description in the STAC specification for details." + } + } + ] + } } -} + } +} \ No newline at end of file diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/basics.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/basics.json index 63d6c7fce..68e8f37ae 100644 --- a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/basics.json +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/basics.json @@ -1,18 +1,18 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/basics.json#", - "title": "Basic Descriptive Fields", - "type": "object", - "properties": { - "title": { - "title": "Item Title", - "description": "A human-readable title describing the Item.", - "type": "string" - }, - "description": { - "title": "Item Description", - "description": "Detailed multi-line description to fully explain the Item.", - "type": "string" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/basics.json#", + "title": "Basic Descriptive Fields", + "type": "object", + "properties": { + "title": { + "title": "Item Title", + "description": "A human-readable title describing the Item.", + "type": "string" + }, + "description": { + "title": "Item Description", + "description": "Detailed multi-line description to fully explain the Item.", + "type": "string" } -} + } +} \ No newline at end of file diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/datetime.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/datetime.json index 2ad06afa9..4c7a3a143 100644 --- a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/datetime.json +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/datetime.json @@ -1,56 +1,53 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/datetime.json#", - "title": "Date and Time Fields", - "type": "object", - "dependencies": { - "start_datetime": { - "required": [ - "end_datetime" - ] - }, - "end_datetime": { - "required": [ - "start_datetime" - ] - } + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/datetime.json#", + "title": "Date and Time Fields", + "type": "object", + "dependencies": { + "start_datetime": { + "required": [ + "end_datetime" + ] }, - "properties": { - "datetime": { - "title": "Date and Time", - "description": "The searchable date/time of the assets, in UTC (Formatted in RFC 3339) ", - "type": [ - "string", - "null" - ], - "format": "date-time", - "pattern": "(\\+00:00|Z)$" - }, - "start_datetime": { - "title": "Start Date and Time", - "description": "The searchable start date/time of the assets, in UTC (Formatted in RFC 3339) ", - "type": "string", - "format": "date-time", - "pattern": "(\\+00:00|Z)$" - }, - "end_datetime": { - "title": "End Date and Time", - "description": "The searchable end date/time of the assets, in UTC (Formatted in RFC 3339) ", - "type": "string", - "format": "date-time", - "pattern": "(\\+00:00|Z)$" - }, - "created": { - "title": "Creation Time", - "type": "string", - "format": "date-time", - "pattern": "(\\+00:00|Z)$" - }, - "updated": { - "title": "Last Update Time", - "type": "string", - "format": "date-time", - "pattern": "(\\+00:00|Z)$" - } + "end_datetime": { + "required": [ + "start_datetime" + ] } -} + }, + "properties": { + "datetime": { + "title": "Date and Time", + "description": "The searchable date/time of the assets, in UTC (Formatted in RFC 3339) ", + "type": ["string", "null"], + "format": "date-time", + "pattern": "(\\+00:00|Z)$" + }, + "start_datetime": { + "title": "Start Date and Time", + "description": "The searchable start date/time of the assets, in UTC (Formatted in RFC 3339) ", + "type": "string", + "format": "date-time", + "pattern": "(\\+00:00|Z)$" + }, + "end_datetime": { + "title": "End Date and Time", + "description": "The searchable end date/time of the assets, in UTC (Formatted in RFC 3339) ", + "type": "string", + "format": "date-time", + "pattern": "(\\+00:00|Z)$" + }, + "created": { + "title": "Creation Time", + "type": "string", + "format": "date-time", + "pattern": "(\\+00:00|Z)$" + }, + "updated": { + "title": "Last Update Time", + "type": "string", + "format": "date-time", + "pattern": "(\\+00:00|Z)$" + } + } +} \ No newline at end of file diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/instrument.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/instrument.json index 4f332f021..688c4a497 100644 --- a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/instrument.json +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/instrument.json @@ -1,32 +1,32 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/instrument.json#", - "title": "Instrument Fields", - "type": "object", - "properties": { - "platform": { - "title": "Platform", - "type": "string" - }, - "instruments": { - "title": "Instruments", - "type": "array", - "items": { - "type": "string" - } - }, - "constellation": { - "title": "Constellation", - "type": "string" - }, - "mission": { - "title": "Mission", - "type": "string" - }, - "gsd": { - "title": "Ground Sample Distance", - "type": "number", - "exclusiveMinimum": 0 - } + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/instrument.json#", + "title": "Instrument Fields", + "type": "object", + "properties": { + "platform": { + "title": "Platform", + "type": "string" + }, + "instruments": { + "title": "Instruments", + "type": "array", + "items": { + "type": "string" + } + }, + "constellation": { + "title": "Constellation", + "type": "string" + }, + "mission": { + "title": "Mission", + "type": "string" + }, + "gsd": { + "title": "Ground Sample Distance", + "type": "number", + "exclusiveMinimum": 0 } -} + } +} \ No newline at end of file diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/item.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/item.json index f2db95ef1..8d4286783 100644 --- a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/item.json +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/item.json @@ -1,272 +1,272 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#", - "title": "STAC Item", - "type": "object", - "description": "This object represents the metadata for an item in a SpatioTemporal Asset Catalog.", - "allOf": [ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#", + "title": "STAC Item", + "type": "object", + "description": "This object represents the metadata for an item in a SpatioTemporal Asset Catalog.", + "allOf": [ + { + "$ref": "#/definitions/core" + } + ], + "definitions": { + "common_metadata": { + "allOf": [ + { + "$ref": "basics.json" + }, + { + "$ref": "datetime.json" + }, + { + "$ref": "instrument.json" + }, { - "$ref": "#/definitions/core" + "$ref": "licensing.json" + }, + { + "$ref": "provider.json" } - ], - "definitions": { - "common_metadata": { - "allOf": [ - { - "$ref": "basics.json" - }, - { - "$ref": "datetime.json" - }, - { - "$ref": "instrument.json" + ] + }, + "core": { + "allOf": [ + { + "$ref": "https://geojson.org/schema/Feature.json" + }, + { + "oneOf": [ + { + "type": "object", + "required": [ + "geometry", + "bbox" + ], + "properties": { + "geometry": { + "$ref": "https://geojson.org/schema/Geometry.json" }, - { - "$ref": "licensing.json" + "bbox": { + "type": "array", + "oneOf": [ + { + "minItems": 4, + "maxItems": 4 + }, + { + "minItems": 6, + "maxItems": 6 + } + ], + "items": { + "type": "number" + } + } + } + }, + { + "type": "object", + "required": [ + "geometry" + ], + "properties": { + "geometry": { + "type": "null" }, - { - "$ref": "provider.json" + "bbox": { + "not": {} } - ] + } + } + ] }, - "core": { - "allOf": [ - { - "$ref": "https://geojson.org/schema/Feature.json" - }, + { + "type": "object", + "required": [ + "stac_version", + "id", + "links", + "assets", + "properties" + ], + "properties": { + "stac_version": { + "title": "STAC version", + "type": "string", + "const": "1.0.0" + }, + "stac_extensions": { + "title": "STAC extensions", + "type": "array", + "uniqueItems": true, + "items": { + "title": "Reference to a JSON Schema", + "type": "string", + "format": "iri" + } + }, + "id": { + "title": "Provider ID", + "description": "Provider item ID", + "type": "string", + "minLength": 1 + }, + "links": { + "title": "Item links", + "description": "Links to item relations", + "type": "array", + "items": { + "$ref": "#/definitions/link" + } + }, + "assets": { + "$ref": "#/definitions/assets" + }, + "properties": { + "allOf": [ { - "oneOf": [ - { - "type": "object", - "required": [ - "geometry", - "bbox" - ], - "properties": { - "geometry": { - "$ref": "https://geojson.org/schema/Geometry.json" - }, - "bbox": { - "type": "array", - "oneOf": [ - { - "minItems": 4, - "maxItems": 4 - }, - { - "minItems": 6, - "maxItems": 6 - } - ], - "items": { - "type": "number" - } - } - } - }, - { - "type": "object", - "required": [ - "geometry" - ], - "properties": { - "geometry": { - "type": "null" - }, - "bbox": { - "not": {} - } - } - } - ] + "$ref": "#/definitions/common_metadata" }, { - "type": "object", - "required": [ - "stac_version", - "id", - "links", - "assets", - "properties" - ], - "properties": { - "stac_version": { - "title": "STAC version", - "type": "string", - "const": "1.0.0" - }, - "stac_extensions": { - "title": "STAC extensions", - "type": "array", - "uniqueItems": true, - "items": { - "title": "Reference to a JSON Schema", - "type": "string", - "format": "iri" - } - }, - "id": { - "title": "Provider ID", - "description": "Provider item ID", - "type": "string", - "minLength": 1 - }, - "links": { - "title": "Item links", - "description": "Links to item relations", - "type": "array", - "items": { - "$ref": "#/definitions/link" - } - }, - "assets": { - "$ref": "#/definitions/assets" - }, - "properties": { - "allOf": [ - { - "$ref": "#/definitions/common_metadata" - }, - { - "anyOf": [ - { - "required": [ - "datetime" - ], - "properties": { - "datetime": { - "not": { - "type": "null" - } - } - } - }, - { - "required": [ - "datetime", - "start_datetime", - "end_datetime" - ] - } - ] - } - ] + "anyOf": [ + { + "required": [ + "datetime" + ], + "properties": { + "datetime": { + "not": { + "type": "null" + } } + } }, - "if": { - "properties": { - "links": { - "contains": { - "required": [ - "rel" - ], - "properties": { - "rel": { - "const": "collection" - } - } - } - } - } - }, - "then": { - "required": [ - "collection" - ], - "properties": { - "collection": { - "title": "Collection ID", - "description": "The ID of the STAC Collection this Item references to.", - "type": "string", - "minLength": 1 - } - } - }, - "else": { - "properties": { - "collection": { - "not": {} - } - } + { + "required": [ + "datetime", + "start_datetime", + "end_datetime" + ] } + ] } - ] - }, - "link": { - "type": "object", + ] + } + }, + "if": { + "properties": { + "links": { + "contains": { + "required": [ + "rel" + ], + "properties": { + "rel": { + "const": "collection" + } + } + } + } + } + }, + "then": { "required": [ - "rel", - "href" + "collection" ], "properties": { - "href": { - "title": "Link reference", - "type": "string", - "format": "iri-reference", - "minLength": 1 - }, - "rel": { - "title": "Link relation type", - "type": "string", - "minLength": 1 - }, - "type": { - "title": "Link type", - "type": "string" - }, - "title": { - "title": "Link title", - "type": "string" - } + "collection": { + "title": "Collection ID", + "description": "The ID of the STAC Collection this Item references to.", + "type": "string", + "minLength": 1 + } } + }, + "else": { + "properties": { + "collection": { + "not": {} + } + } + } + } + ] + }, + "link": { + "type": "object", + "required": [ + "rel", + "href" + ], + "properties": { + "href": { + "title": "Link reference", + "type": "string", + "format": "iri-reference", + "minLength": 1 + }, + "rel": { + "title": "Link relation type", + "type": "string", + "minLength": 1 }, - "assets": { - "title": "Asset links", - "description": "Links to assets", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/asset" + "type": { + "title": "Link type", + "type": "string" + }, + "title": { + "title": "Link title", + "type": "string" + } + } + }, + "assets": { + "title": "Asset links", + "description": "Links to assets", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/asset" + } + }, + "asset": { + "allOf": [ + { + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "title": "Asset reference", + "type": "string", + "format": "iri-reference", + "minLength": 1 + }, + "title": { + "title": "Asset title", + "type": "string" + }, + "description": { + "title": "Asset description", + "type": "string" + }, + "type": { + "title": "Asset type", + "type": "string" + }, + "roles": { + "title": "Asset roles", + "type": "array", + "items": { + "type": "string" + } } + } }, - "asset": { - "allOf": [ - { - "type": "object", - "required": [ - "href" - ], - "properties": { - "href": { - "title": "Asset reference", - "type": "string", - "format": "iri-reference", - "minLength": 1 - }, - "title": { - "title": "Asset title", - "type": "string" - }, - "description": { - "title": "Asset description", - "type": "string" - }, - "type": { - "title": "Asset type", - "type": "string" - }, - "roles": { - "title": "Asset roles", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - { - "$ref": "#/definitions/common_metadata" - } - ] + { + "$ref": "#/definitions/common_metadata" } + ] } + } } diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/itemcollection.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/itemcollection.json index 9d2071610..0a2ea0937 100644 --- a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/itemcollection.json +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/itemcollection.json @@ -1,82 +1,82 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "itemcollection.json#", - "title": "STAC ItemCollection", - "type": "object", - "description": "This object represents the metadata for a set of items in a SpatioTemporal Asset Catalog.", - "additionalProperties": true, - "allOf": [ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "itemcollection.json#", + "title": "STAC ItemCollection", + "type": "object", + "description": "This object represents the metadata for a set of items in a SpatioTemporal Asset Catalog.", + "additionalProperties": true, + "allOf": [ + { + "$ref": "#/definitions/core" + } + ], + "definitions": { + "core": { + "allOf": [ { - "$ref": "#/definitions/core" - } - ], - "definitions": { - "core": { - "allOf": [ - { - "oneOf": [ - { - "$ref": "https://geojson.org/schema/FeatureCollection.json" - } + "oneOf": [ + { + "$ref": "https://geojson.org/schema/FeatureCollection.json" + } + ] + }, + { + "type": "object", + "required": [ + "type", + "features" + ], + "properties": { + "stac_version": { + "title": "STAC version", + "type": "string", + "const": "1.0.0" + }, + "stac_extensions": { + "title": "STAC extensions", + "type": "array", + "uniqueItems": true, + "items": { + "anyOf": [ + { + "title": "Reference to a JSON Schema", + "type": "string", + "format": "uri" + }, + { + "title": "Reference to a core extension", + "type": "string", + "enum": [ + "single-file-stac" ] - }, - { - "type": "object", - "required": [ - "type", - "features" - ], - "properties": { - "stac_version": { - "title": "STAC version", - "type": "string", - "const": "1.0.0" - }, - "stac_extensions": { - "title": "STAC extensions", - "type": "array", - "uniqueItems": true, - "items": { - "anyOf": [ - { - "title": "Reference to a JSON Schema", - "type": "string", - "format": "uri" - }, - { - "title": "Reference to a core extension", - "type": "string", - "enum": [ - "single-file-stac" - ] - } - ] - } - }, - "type": { - "title": "Type", - "description": "Type of entity, always FeatureCollection", - "type": "string" - }, - "features": { - "title": "ItemCollection features", - "description": "Items in this item collection", - "type": "array", - "items": { - "$ref": "item.json" - } - }, - "links": { - "title": "Links", - "description": "Links to item collection relations", - "type": "array", - "items": { - "$ref": "item.json#/definitions/link" - } - } - } - } - ] + } + ] + } + }, + "type": { + "title": "Type", + "description": "Type of entity, always FeatureCollection", + "type": "string" + }, + "features": { + "title": "ItemCollection features", + "description": "Items in this item collection", + "type": "array", + "items": { + "$ref": "item.json" + } + }, + "links": { + "title": "Links", + "description": "Links to item collection relations", + "type": "array", + "items": { + "$ref": "item.json#/definitions/link" + } + } + } } + ] } + } } diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/licensing.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/licensing.json index 7c40cab9d..ca0eed8b9 100644 --- a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/licensing.json +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/licensing.json @@ -1,12 +1,12 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/licensing.json#", - "title": "Licensing Fields", - "type": "object", - "properties": { - "license": { - "type": "string", - "pattern": "^[\\w\\-\\.\\+]+$" - } + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/licensing.json#", + "title": "Licensing Fields", + "type": "object", + "properties": { + "license": { + "type": "string", + "pattern": "^[\\w\\-\\.\\+]+$" } -} + } +} \ No newline at end of file diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/provider.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/provider.json index 5260b5db0..01cfadcec 100644 --- a/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/provider.json +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/item-spec/json-schema/provider.json @@ -1,47 +1,47 @@ { - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/provider.json#", - "title": "Provider Fields", - "type": "object", - "properties": { - "providers": { - "title": "Providers", + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/provider.json#", + "title": "Provider Fields", + "type": "object", + "properties": { + "providers": { + "title": "Providers", + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "title": "Organization name", + "type": "string", + "minLength": 1 + }, + "description": { + "title": "Organization description", + "type": "string" + }, + "roles": { + "title": "Organization roles", "type": "array", "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "title": "Organization name", - "type": "string", - "minLength": 1 - }, - "description": { - "title": "Organization description", - "type": "string" - }, - "roles": { - "title": "Organization roles", - "type": "array", - "items": { - "type": "string", - "enum": [ - "producer", - "licensor", - "processor", - "host" - ] - } - }, - "url": { - "title": "Organization homepage", - "type": "string", - "format": "iri" - } - } + "type": "string", + "enum": [ + "producer", + "licensor", + "processor", + "host" + ] } + }, + "url": { + "title": "Organization homepage", + "type": "string", + "format": "iri" + } } + } } -} + } +} \ No newline at end of file diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/catalog-spec/json-schema/catalog.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/catalog-spec/json-schema/catalog.json new file mode 100644 index 000000000..31b2c8f8a --- /dev/null +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/catalog-spec/json-schema/catalog.json @@ -0,0 +1,94 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/catalog-spec/json-schema/catalog.json#", + "title": "STAC Catalog Specification", + "description": "This object represents Catalogs in a SpatioTemporal Asset Catalog.", + "allOf": [ + { + "$ref": "#/definitions/catalog" + } + ], + "definitions": { + "catalog": { + "title": "STAC Catalog", + "type": "object", + "required": [ + "stac_version", + "type", + "id", + "description", + "links" + ], + "properties": { + "stac_version": { + "title": "STAC version", + "type": "string", + "const": "1.0.0" + }, + "stac_extensions": { + "title": "STAC extensions", + "type": "array", + "uniqueItems": true, + "items": { + "title": "Reference to a JSON Schema", + "type": "string", + "format": "iri" + } + }, + "type": { + "title": "Type of STAC entity", + "const": "Catalog" + }, + "id": { + "title": "Identifier", + "type": "string", + "minLength": 1 + }, + "title": { + "title": "Title", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string", + "minLength": 1 + }, + "links": { + "title": "Links", + "type": "array", + "items": { + "$ref": "#/definitions/link" + } + } + } + }, + "link": { + "type": "object", + "required": [ + "rel", + "href" + ], + "properties": { + "href": { + "title": "Link reference", + "type": "string", + "format": "iri-reference", + "minLength": 1 + }, + "rel": { + "title": "Link relation type", + "type": "string", + "minLength": 1 + }, + "type": { + "title": "Link type", + "type": "string" + }, + "title": { + "title": "Link title", + "type": "string" + } + } + } + } +} diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/collection-spec/json-schema/collection.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/collection-spec/json-schema/collection.json new file mode 100644 index 000000000..2ad20902d --- /dev/null +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/collection-spec/json-schema/collection.json @@ -0,0 +1,270 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json#", + "title": "STAC Collection Specification", + "description": "This object represents Collections in a SpatioTemporal Asset Catalog.", + "allOf": [ + { + "$ref": "#/definitions/collection" + } + ], + "definitions": { + "collection": { + "title": "STAC Collection", + "description": "These are the fields specific to a STAC Collection. All other fields are inherited from STAC Catalog.", + "type": "object", + "required": [ + "stac_version", + "type", + "id", + "description", + "license", + "extent", + "links" + ], + "properties": { + "stac_version": { + "title": "STAC version", + "type": "string", + "const": "1.0.0" + }, + "stac_extensions": { + "title": "STAC extensions", + "type": "array", + "uniqueItems": true, + "items": { + "title": "Reference to a JSON Schema", + "type": "string", + "format": "iri" + } + }, + "type": { + "title": "Type of STAC entity", + "const": "Collection" + }, + "id": { + "title": "Identifier", + "type": "string", + "minLength": 1 + }, + "title": { + "title": "Title", + "type": "string" + }, + "description": { + "title": "Description", + "type": "string", + "minLength": 1 + }, + "keywords": { + "title": "Keywords", + "type": "array", + "items": { + "type": "string" + } + }, + "license": { + "title": "Collection License Name", + "type": "string", + "pattern": "^[\\w\\-\\.\\+]+$" + }, + "providers": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "title": "Organization name", + "type": "string" + }, + "description": { + "title": "Organization description", + "type": "string" + }, + "roles": { + "title": "Organization roles", + "type": "array", + "items": { + "type": "string", + "enum": [ + "producer", + "licensor", + "processor", + "host" + ] + } + }, + "url": { + "title": "Organization homepage", + "type": "string", + "format": "iri" + } + } + } + }, + "extent": { + "title": "Extents", + "type": "object", + "required": [ + "spatial", + "temporal" + ], + "properties": { + "spatial": { + "title": "Spatial extent object", + "type": "object", + "required": [ + "bbox" + ], + "properties": { + "bbox": { + "title": "Spatial extents", + "type": "array", + "minItems": 1, + "items": { + "title": "Spatial extent", + "type": "array", + "oneOf": [ + { + "minItems":4, + "maxItems":4 + }, + { + "minItems":6, + "maxItems":6 + } + ], + "items": { + "type": "number" + } + } + } + } + }, + "temporal": { + "title": "Temporal extent object", + "type": "object", + "required": [ + "interval" + ], + "properties": { + "interval": { + "title": "Temporal extents", + "type": "array", + "minItems": 1, + "items": { + "title": "Temporal extent", + "type": "array", + "minItems": 2, + "maxItems": 2, + "items": { + "type": [ + "string", + "null" + ], + "format": "date-time", + "pattern": "(\\+00:00|Z)$" + } + } + } + } + } + } + }, + "assets": { + "$ref": "../../item-spec/json-schema/item.json#/definitions/assets" + }, + "links": { + "title": "Links", + "type": "array", + "items": { + "$ref": "#/definitions/link" + } + }, + "summaries": { + "$ref": "#/definitions/summaries" + } + } + }, + "link": { + "type": "object", + "required": [ + "rel", + "href" + ], + "properties": { + "href": { + "title": "Link reference", + "type": "string", + "format": "iri-reference", + "minLength": 1 + }, + "rel": { + "title": "Link relation type", + "type": "string", + "minLength": 1 + }, + "type": { + "title": "Link type", + "type": "string" + }, + "title": { + "title": "Link title", + "type": "string" + } + } + }, + "summaries": { + "type": "object", + "additionalProperties": { + "anyOf": [ + { + "title": "JSON Schema", + "type": "object", + "minProperties": 1, + "allOf": [ + { + "$ref": "http://json-schema.org/draft-07/schema" + } + ] + }, + { + "title": "Range", + "type": "object", + "required": [ + "minimum", + "maximum" + ], + "properties": { + "minimum": { + "title": "Minimum value", + "type": [ + "number", + "string" + ] + }, + "maximum": { + "title": "Maximum value", + "type": [ + "number", + "string" + ] + } + } + }, + { + "title": "Set of values", + "type": "array", + "minItems": 1, + "items": { + "description": "For each field only the original data type of the property can occur (except for arrays), but we can't validate that in JSON Schema yet. See the sumamry description in the STAC specification for details." + } + } + ] + } + } + } +} \ No newline at end of file diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/basics.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/basics.json new file mode 100644 index 000000000..68e8f37ae --- /dev/null +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/basics.json @@ -0,0 +1,18 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/basics.json#", + "title": "Basic Descriptive Fields", + "type": "object", + "properties": { + "title": { + "title": "Item Title", + "description": "A human-readable title describing the Item.", + "type": "string" + }, + "description": { + "title": "Item Description", + "description": "Detailed multi-line description to fully explain the Item.", + "type": "string" + } + } +} \ No newline at end of file diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/datetime.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/datetime.json new file mode 100644 index 000000000..4c7a3a143 --- /dev/null +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/datetime.json @@ -0,0 +1,53 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/datetime.json#", + "title": "Date and Time Fields", + "type": "object", + "dependencies": { + "start_datetime": { + "required": [ + "end_datetime" + ] + }, + "end_datetime": { + "required": [ + "start_datetime" + ] + } + }, + "properties": { + "datetime": { + "title": "Date and Time", + "description": "The searchable date/time of the assets, in UTC (Formatted in RFC 3339) ", + "type": ["string", "null"], + "format": "date-time", + "pattern": "(\\+00:00|Z)$" + }, + "start_datetime": { + "title": "Start Date and Time", + "description": "The searchable start date/time of the assets, in UTC (Formatted in RFC 3339) ", + "type": "string", + "format": "date-time", + "pattern": "(\\+00:00|Z)$" + }, + "end_datetime": { + "title": "End Date and Time", + "description": "The searchable end date/time of the assets, in UTC (Formatted in RFC 3339) ", + "type": "string", + "format": "date-time", + "pattern": "(\\+00:00|Z)$" + }, + "created": { + "title": "Creation Time", + "type": "string", + "format": "date-time", + "pattern": "(\\+00:00|Z)$" + }, + "updated": { + "title": "Last Update Time", + "type": "string", + "format": "date-time", + "pattern": "(\\+00:00|Z)$" + } + } +} \ No newline at end of file diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/instrument.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/instrument.json new file mode 100644 index 000000000..688c4a497 --- /dev/null +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/instrument.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/instrument.json#", + "title": "Instrument Fields", + "type": "object", + "properties": { + "platform": { + "title": "Platform", + "type": "string" + }, + "instruments": { + "title": "Instruments", + "type": "array", + "items": { + "type": "string" + } + }, + "constellation": { + "title": "Constellation", + "type": "string" + }, + "mission": { + "title": "Mission", + "type": "string" + }, + "gsd": { + "title": "Ground Sample Distance", + "type": "number", + "exclusiveMinimum": 0 + } + } +} \ No newline at end of file diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/item.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/item.json new file mode 100644 index 000000000..8d4286783 --- /dev/null +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/item.json @@ -0,0 +1,272 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#", + "title": "STAC Item", + "type": "object", + "description": "This object represents the metadata for an item in a SpatioTemporal Asset Catalog.", + "allOf": [ + { + "$ref": "#/definitions/core" + } + ], + "definitions": { + "common_metadata": { + "allOf": [ + { + "$ref": "basics.json" + }, + { + "$ref": "datetime.json" + }, + { + "$ref": "instrument.json" + }, + { + "$ref": "licensing.json" + }, + { + "$ref": "provider.json" + } + ] + }, + "core": { + "allOf": [ + { + "$ref": "https://geojson.org/schema/Feature.json" + }, + { + "oneOf": [ + { + "type": "object", + "required": [ + "geometry", + "bbox" + ], + "properties": { + "geometry": { + "$ref": "https://geojson.org/schema/Geometry.json" + }, + "bbox": { + "type": "array", + "oneOf": [ + { + "minItems": 4, + "maxItems": 4 + }, + { + "minItems": 6, + "maxItems": 6 + } + ], + "items": { + "type": "number" + } + } + } + }, + { + "type": "object", + "required": [ + "geometry" + ], + "properties": { + "geometry": { + "type": "null" + }, + "bbox": { + "not": {} + } + } + } + ] + }, + { + "type": "object", + "required": [ + "stac_version", + "id", + "links", + "assets", + "properties" + ], + "properties": { + "stac_version": { + "title": "STAC version", + "type": "string", + "const": "1.0.0" + }, + "stac_extensions": { + "title": "STAC extensions", + "type": "array", + "uniqueItems": true, + "items": { + "title": "Reference to a JSON Schema", + "type": "string", + "format": "iri" + } + }, + "id": { + "title": "Provider ID", + "description": "Provider item ID", + "type": "string", + "minLength": 1 + }, + "links": { + "title": "Item links", + "description": "Links to item relations", + "type": "array", + "items": { + "$ref": "#/definitions/link" + } + }, + "assets": { + "$ref": "#/definitions/assets" + }, + "properties": { + "allOf": [ + { + "$ref": "#/definitions/common_metadata" + }, + { + "anyOf": [ + { + "required": [ + "datetime" + ], + "properties": { + "datetime": { + "not": { + "type": "null" + } + } + } + }, + { + "required": [ + "datetime", + "start_datetime", + "end_datetime" + ] + } + ] + } + ] + } + }, + "if": { + "properties": { + "links": { + "contains": { + "required": [ + "rel" + ], + "properties": { + "rel": { + "const": "collection" + } + } + } + } + } + }, + "then": { + "required": [ + "collection" + ], + "properties": { + "collection": { + "title": "Collection ID", + "description": "The ID of the STAC Collection this Item references to.", + "type": "string", + "minLength": 1 + } + } + }, + "else": { + "properties": { + "collection": { + "not": {} + } + } + } + } + ] + }, + "link": { + "type": "object", + "required": [ + "rel", + "href" + ], + "properties": { + "href": { + "title": "Link reference", + "type": "string", + "format": "iri-reference", + "minLength": 1 + }, + "rel": { + "title": "Link relation type", + "type": "string", + "minLength": 1 + }, + "type": { + "title": "Link type", + "type": "string" + }, + "title": { + "title": "Link title", + "type": "string" + } + } + }, + "assets": { + "title": "Asset links", + "description": "Links to assets", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/asset" + } + }, + "asset": { + "allOf": [ + { + "type": "object", + "required": [ + "href" + ], + "properties": { + "href": { + "title": "Asset reference", + "type": "string", + "format": "iri-reference", + "minLength": 1 + }, + "title": { + "title": "Asset title", + "type": "string" + }, + "description": { + "title": "Asset description", + "type": "string" + }, + "type": { + "title": "Asset type", + "type": "string" + }, + "roles": { + "title": "Asset roles", + "type": "array", + "items": { + "type": "string" + } + } + } + }, + { + "$ref": "#/definitions/common_metadata" + } + ] + } + } +} diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/licensing.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/licensing.json new file mode 100644 index 000000000..ca0eed8b9 --- /dev/null +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/licensing.json @@ -0,0 +1,12 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/licensing.json#", + "title": "Licensing Fields", + "type": "object", + "properties": { + "license": { + "type": "string", + "pattern": "^[\\w\\-\\.\\+]+$" + } + } +} \ No newline at end of file diff --git a/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/provider.json b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/provider.json new file mode 100644 index 000000000..01cfadcec --- /dev/null +++ b/integration_tests/schemas/schemas.stacspec.org/1.0.0/stac-spec/item-spec/json-schema/provider.json @@ -0,0 +1,47 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/provider.json#", + "title": "Provider Fields", + "type": "object", + "properties": { + "providers": { + "title": "Providers", + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "title": "Organization name", + "type": "string", + "minLength": 1 + }, + "description": { + "title": "Organization description", + "type": "string" + }, + "roles": { + "title": "Organization roles", + "type": "array", + "items": { + "type": "string", + "enum": [ + "producer", + "licensor", + "processor", + "host" + ] + } + }, + "url": { + "title": "Organization homepage", + "type": "string", + "format": "iri" + } + } + } + } + } +} \ No newline at end of file diff --git a/integration_tests/schemas/schemas.stacspec.org/master/fragments/context/json-schema/schema.json b/integration_tests/schemas/schemas.stacspec.org/master/fragments/context/json-schema/schema.json deleted file mode 100644 index 8ce8434b8..000000000 --- a/integration_tests/schemas/schemas.stacspec.org/master/fragments/context/json-schema/schema.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "schema.json#", - "title": "Context Extension", - "type": "object", - "description": "STAC context metadata", - "allOf": [ - { - "$ref": "#/definitions/context" - } - ], - "definitions": { - "context": { - "type": "object", - "required": [ - "context" - ], - "properties": { - "context": { - "type": "object", - "required": [ - "returned" - ], - "properties": { - "returned": { - "type": "integer", - "minimum": 0 - }, - "limit": { - "type": [ - "integer", - "null" - ], - "minimum": 0 - }, - "matched": { - "type": "integer", - "minimum": 0 - } - } - } - } - } - } -} diff --git a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/catalog-spec/json-schema/catalog.json b/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/catalog-spec/json-schema/catalog.json deleted file mode 100644 index 370d4db06..000000000 --- a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/catalog-spec/json-schema/catalog.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/catalog-spec/json-schema/catalog.json#", - "title": "STAC Catalog Specification", - "description": "This object represents Catalogs in a SpatioTemporal Asset Catalog.", - "allOf": [ - { - "$ref": "#/definitions/catalog" - } - ], - "definitions": { - "catalog": { - "title": "STAC Catalog", - "type": "object", - "required": [ - "stac_version", - "type", - "id", - "description", - "links" - ], - "properties": { - "stac_version": { - "title": "STAC version", - "type": "string", - "const": "1.0.0" - }, - "stac_extensions": { - "title": "STAC extensions", - "type": "array", - "uniqueItems": true, - "items": { - "title": "Reference to a JSON Schema", - "type": "string", - "format": "iri" - } - }, - "type": { - "title": "Type of STAC entity", - "const": "Catalog" - }, - "id": { - "title": "Identifier", - "type": "string", - "minLength": 1 - }, - "title": { - "title": "Title", - "type": "string" - }, - "description": { - "title": "Description", - "type": "string", - "minLength": 1 - }, - "links": { - "title": "Links", - "type": "array", - "items": { - "$ref": "#/definitions/link" - } - } - } - }, - "link": { - "type": "object", - "required": [ - "rel", - "href" - ], - "properties": { - "href": { - "title": "Link reference", - "type": "string", - "format": "iri-reference", - "minLength": 1 - }, - "rel": { - "title": "Link relation type", - "type": "string", - "minLength": 1 - }, - "type": { - "title": "Link type", - "type": "string" - }, - "title": { - "title": "Link title", - "type": "string" - } - } - } - } -} diff --git a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/collection-spec/json-schema/collection.json b/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/collection-spec/json-schema/collection.json deleted file mode 100644 index 3dc1fab00..000000000 --- a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/collection-spec/json-schema/collection.json +++ /dev/null @@ -1,270 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/collection-spec/json-schema/collection.json#", - "title": "STAC Collection Specification", - "description": "This object represents Collections in a SpatioTemporal Asset Catalog.", - "allOf": [ - { - "$ref": "#/definitions/collection" - } - ], - "definitions": { - "collection": { - "title": "STAC Collection", - "description": "These are the fields specific to a STAC Collection. All other fields are inherited from STAC Catalog.", - "type": "object", - "required": [ - "stac_version", - "type", - "id", - "description", - "license", - "extent", - "links" - ], - "properties": { - "stac_version": { - "title": "STAC version", - "type": "string", - "const": "1.0.0" - }, - "stac_extensions": { - "title": "STAC extensions", - "type": "array", - "uniqueItems": true, - "items": { - "title": "Reference to a JSON Schema", - "type": "string", - "format": "iri" - } - }, - "type": { - "title": "Type of STAC entity", - "const": "Collection" - }, - "id": { - "title": "Identifier", - "type": "string", - "minLength": 1 - }, - "title": { - "title": "Title", - "type": "string" - }, - "description": { - "title": "Description", - "type": "string", - "minLength": 1 - }, - "keywords": { - "title": "Keywords", - "type": "array", - "items": { - "type": "string" - } - }, - "license": { - "title": "Collection License Name", - "type": "string", - "pattern": "^[\\w\\-\\.\\+]+$" - }, - "providers": { - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "title": "Organization name", - "type": "string" - }, - "description": { - "title": "Organization description", - "type": "string" - }, - "roles": { - "title": "Organization roles", - "type": "array", - "items": { - "type": "string", - "enum": [ - "producer", - "licensor", - "processor", - "host" - ] - } - }, - "url": { - "title": "Organization homepage", - "type": "string", - "format": "iri" - } - } - } - }, - "extent": { - "title": "Extents", - "type": "object", - "required": [ - "spatial", - "temporal" - ], - "properties": { - "spatial": { - "title": "Spatial extent object", - "type": "object", - "required": [ - "bbox" - ], - "properties": { - "bbox": { - "title": "Spatial extents", - "type": "array", - "minItems": 1, - "items": { - "title": "Spatial extent", - "type": "array", - "oneOf": [ - { - "minItems": 4, - "maxItems": 4 - }, - { - "minItems": 6, - "maxItems": 6 - } - ], - "items": { - "type": "number" - } - } - } - } - }, - "temporal": { - "title": "Temporal extent object", - "type": "object", - "required": [ - "interval" - ], - "properties": { - "interval": { - "title": "Temporal extents", - "type": "array", - "minItems": 1, - "items": { - "title": "Temporal extent", - "type": "array", - "minItems": 2, - "maxItems": 2, - "items": { - "type": [ - "string", - "null" - ], - "format": "date-time", - "pattern": "(\\+00:00|Z)$" - } - } - } - } - } - } - }, - "assets": { - "$ref": "../../item-spec/json-schema/item.json#/definitions/assets" - }, - "links": { - "title": "Links", - "type": "array", - "items": { - "$ref": "#/definitions/link" - } - }, - "summaries": { - "$ref": "#/definitions/summaries" - } - } - }, - "link": { - "type": "object", - "required": [ - "rel", - "href" - ], - "properties": { - "href": { - "title": "Link reference", - "type": "string", - "format": "iri-reference", - "minLength": 1 - }, - "rel": { - "title": "Link relation type", - "type": "string", - "minLength": 1 - }, - "type": { - "title": "Link type", - "type": "string" - }, - "title": { - "title": "Link title", - "type": "string" - } - } - }, - "summaries": { - "type": "object", - "additionalProperties": { - "anyOf": [ - { - "title": "JSON Schema", - "type": "object", - "minProperties": 1, - "allOf": [ - { - "$ref": "http://json-schema.org/draft-07/schema" - } - ] - }, - { - "title": "Range", - "type": "object", - "required": [ - "minimum", - "maximum" - ], - "properties": { - "minimum": { - "title": "Minimum value", - "type": [ - "number", - "string" - ] - }, - "maximum": { - "title": "Maximum value", - "type": [ - "number", - "string" - ] - } - } - }, - { - "title": "Set of values", - "type": "array", - "minItems": 1, - "items": { - "description": "For each field only the original data type of the property can occur (except for arrays), but we can't validate that in JSON Schema yet. See the sumamry description in the STAC specification for details." - } - } - ] - } - } - } -} diff --git a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/basics.json b/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/basics.json deleted file mode 100644 index 63d6c7fce..000000000 --- a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/basics.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/basics.json#", - "title": "Basic Descriptive Fields", - "type": "object", - "properties": { - "title": { - "title": "Item Title", - "description": "A human-readable title describing the Item.", - "type": "string" - }, - "description": { - "title": "Item Description", - "description": "Detailed multi-line description to fully explain the Item.", - "type": "string" - } - } -} diff --git a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/datetime.json b/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/datetime.json deleted file mode 100644 index 2ad06afa9..000000000 --- a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/datetime.json +++ /dev/null @@ -1,56 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/datetime.json#", - "title": "Date and Time Fields", - "type": "object", - "dependencies": { - "start_datetime": { - "required": [ - "end_datetime" - ] - }, - "end_datetime": { - "required": [ - "start_datetime" - ] - } - }, - "properties": { - "datetime": { - "title": "Date and Time", - "description": "The searchable date/time of the assets, in UTC (Formatted in RFC 3339) ", - "type": [ - "string", - "null" - ], - "format": "date-time", - "pattern": "(\\+00:00|Z)$" - }, - "start_datetime": { - "title": "Start Date and Time", - "description": "The searchable start date/time of the assets, in UTC (Formatted in RFC 3339) ", - "type": "string", - "format": "date-time", - "pattern": "(\\+00:00|Z)$" - }, - "end_datetime": { - "title": "End Date and Time", - "description": "The searchable end date/time of the assets, in UTC (Formatted in RFC 3339) ", - "type": "string", - "format": "date-time", - "pattern": "(\\+00:00|Z)$" - }, - "created": { - "title": "Creation Time", - "type": "string", - "format": "date-time", - "pattern": "(\\+00:00|Z)$" - }, - "updated": { - "title": "Last Update Time", - "type": "string", - "format": "date-time", - "pattern": "(\\+00:00|Z)$" - } - } -} diff --git a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/instrument.json b/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/instrument.json deleted file mode 100644 index 4f332f021..000000000 --- a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/instrument.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/instrument.json#", - "title": "Instrument Fields", - "type": "object", - "properties": { - "platform": { - "title": "Platform", - "type": "string" - }, - "instruments": { - "title": "Instruments", - "type": "array", - "items": { - "type": "string" - } - }, - "constellation": { - "title": "Constellation", - "type": "string" - }, - "mission": { - "title": "Mission", - "type": "string" - }, - "gsd": { - "title": "Ground Sample Distance", - "type": "number", - "exclusiveMinimum": 0 - } - } -} diff --git a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/item.json b/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/item.json deleted file mode 100644 index f2db95ef1..000000000 --- a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/item.json +++ /dev/null @@ -1,272 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/item.json#", - "title": "STAC Item", - "type": "object", - "description": "This object represents the metadata for an item in a SpatioTemporal Asset Catalog.", - "allOf": [ - { - "$ref": "#/definitions/core" - } - ], - "definitions": { - "common_metadata": { - "allOf": [ - { - "$ref": "basics.json" - }, - { - "$ref": "datetime.json" - }, - { - "$ref": "instrument.json" - }, - { - "$ref": "licensing.json" - }, - { - "$ref": "provider.json" - } - ] - }, - "core": { - "allOf": [ - { - "$ref": "https://geojson.org/schema/Feature.json" - }, - { - "oneOf": [ - { - "type": "object", - "required": [ - "geometry", - "bbox" - ], - "properties": { - "geometry": { - "$ref": "https://geojson.org/schema/Geometry.json" - }, - "bbox": { - "type": "array", - "oneOf": [ - { - "minItems": 4, - "maxItems": 4 - }, - { - "minItems": 6, - "maxItems": 6 - } - ], - "items": { - "type": "number" - } - } - } - }, - { - "type": "object", - "required": [ - "geometry" - ], - "properties": { - "geometry": { - "type": "null" - }, - "bbox": { - "not": {} - } - } - } - ] - }, - { - "type": "object", - "required": [ - "stac_version", - "id", - "links", - "assets", - "properties" - ], - "properties": { - "stac_version": { - "title": "STAC version", - "type": "string", - "const": "1.0.0" - }, - "stac_extensions": { - "title": "STAC extensions", - "type": "array", - "uniqueItems": true, - "items": { - "title": "Reference to a JSON Schema", - "type": "string", - "format": "iri" - } - }, - "id": { - "title": "Provider ID", - "description": "Provider item ID", - "type": "string", - "minLength": 1 - }, - "links": { - "title": "Item links", - "description": "Links to item relations", - "type": "array", - "items": { - "$ref": "#/definitions/link" - } - }, - "assets": { - "$ref": "#/definitions/assets" - }, - "properties": { - "allOf": [ - { - "$ref": "#/definitions/common_metadata" - }, - { - "anyOf": [ - { - "required": [ - "datetime" - ], - "properties": { - "datetime": { - "not": { - "type": "null" - } - } - } - }, - { - "required": [ - "datetime", - "start_datetime", - "end_datetime" - ] - } - ] - } - ] - } - }, - "if": { - "properties": { - "links": { - "contains": { - "required": [ - "rel" - ], - "properties": { - "rel": { - "const": "collection" - } - } - } - } - } - }, - "then": { - "required": [ - "collection" - ], - "properties": { - "collection": { - "title": "Collection ID", - "description": "The ID of the STAC Collection this Item references to.", - "type": "string", - "minLength": 1 - } - } - }, - "else": { - "properties": { - "collection": { - "not": {} - } - } - } - } - ] - }, - "link": { - "type": "object", - "required": [ - "rel", - "href" - ], - "properties": { - "href": { - "title": "Link reference", - "type": "string", - "format": "iri-reference", - "minLength": 1 - }, - "rel": { - "title": "Link relation type", - "type": "string", - "minLength": 1 - }, - "type": { - "title": "Link type", - "type": "string" - }, - "title": { - "title": "Link title", - "type": "string" - } - } - }, - "assets": { - "title": "Asset links", - "description": "Links to assets", - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/asset" - } - }, - "asset": { - "allOf": [ - { - "type": "object", - "required": [ - "href" - ], - "properties": { - "href": { - "title": "Asset reference", - "type": "string", - "format": "iri-reference", - "minLength": 1 - }, - "title": { - "title": "Asset title", - "type": "string" - }, - "description": { - "title": "Asset description", - "type": "string" - }, - "type": { - "title": "Asset type", - "type": "string" - }, - "roles": { - "title": "Asset roles", - "type": "array", - "items": { - "type": "string" - } - } - } - }, - { - "$ref": "#/definitions/common_metadata" - } - ] - } - } -} diff --git a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/licensing.json b/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/licensing.json deleted file mode 100644 index 7c40cab9d..000000000 --- a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/licensing.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/licensing.json#", - "title": "Licensing Fields", - "type": "object", - "properties": { - "license": { - "type": "string", - "pattern": "^[\\w\\-\\.\\+]+$" - } - } -} diff --git a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/provider.json b/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/provider.json deleted file mode 100644 index 5260b5db0..000000000 --- a/integration_tests/schemas/schemas.stacspec.org/master/stac-spec/item-spec/json-schema/provider.json +++ /dev/null @@ -1,47 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://schemas.stacspec.org/v1.0.0/item-spec/json-schema/provider.json#", - "title": "Provider Fields", - "type": "object", - "properties": { - "providers": { - "title": "Providers", - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "title": "Organization name", - "type": "string", - "minLength": 1 - }, - "description": { - "title": "Organization description", - "type": "string" - }, - "roles": { - "title": "Organization roles", - "type": "array", - "items": { - "type": "string", - "enum": [ - "producer", - "licensor", - "processor", - "host" - ] - } - }, - "url": { - "title": "Organization homepage", - "type": "string", - "format": "iri" - } - } - } - } - } -} diff --git a/integration_tests/schemas/stac-api/1.0.0 b/integration_tests/schemas/stac-api/1.0.0 new file mode 120000 index 000000000..70f03a8c8 --- /dev/null +++ b/integration_tests/schemas/stac-api/1.0.0 @@ -0,0 +1 @@ +../schemas.stacspec.org/1.0.0 \ No newline at end of file diff --git a/integration_tests/schemas/stac-api/master b/integration_tests/schemas/stac-api/master deleted file mode 120000 index 4395c46ef..000000000 --- a/integration_tests/schemas/stac-api/master +++ /dev/null @@ -1 +0,0 @@ -../schemas.stacspec.org/master \ No newline at end of file From 0c6ef0f4b5632629aae34e1eee132f6738e64206 Mon Sep 17 00:00:00 2001 From: "Peter A. Jonsson" Date: Mon, 20 Nov 2023 14:58:27 +0100 Subject: [PATCH 5/5] integration_tests: update stac-extension version I am not sure if it is the schema update, or some external change, but these versions are what are returned from these tests now. --- integration_tests/test_eo3_support.py | 2 +- integration_tests/test_stac.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/integration_tests/test_eo3_support.py b/integration_tests/test_eo3_support.py index a445920de..beb698b96 100644 --- a/integration_tests/test_eo3_support.py +++ b/integration_tests/test_eo3_support.py @@ -282,7 +282,7 @@ def test_eo3_stac_item(eo3_index, client: FlaskClient): expected = { "stac_version": "1.0.0", "stac_extensions": [ - "https://stac-extensions.github.io/eo/v1.0.0/schema.json", + "https://stac-extensions.github.io/eo/v1.1.0/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", "https://stac-extensions.github.io/view/v1.0.0/schema.json", ], diff --git a/integration_tests/test_stac.py b/integration_tests/test_stac.py index 2c6829b02..17cd0e977 100644 --- a/integration_tests/test_stac.py +++ b/integration_tests/test_stac.py @@ -745,7 +745,7 @@ def dataset_url(s: str): expected = { "stac_version": "1.0.0", "stac_extensions": [ - "https://stac-extensions.github.io/eo/v1.0.0/schema.json", + "https://stac-extensions.github.io/eo/v1.1.0/schema.json", "https://stac-extensions.github.io/projection/v1.1.0/schema.json", ], "type": "Feature",