From 64e34d07b65f42465e3ddae53c4739ed4d0a7517 Mon Sep 17 00:00:00 2001 From: rhysrevans3 Date: Thu, 16 Jan 2025 12:37:26 +0000 Subject: [PATCH 1/4] Following sentinel 1 schema. --- json-schema/schema.json | 67 ++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 38 deletions(-) diff --git a/json-schema/schema.json b/json-schema/schema.json index cf5500e..06e3560 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -3,54 +3,45 @@ "$id": "https://stac-extensions.github.io/cmip6/v1.0.0/schema.json#", "title": "CMIP6 Extension", "description": "STAC CMIP6 Extension for STAC Items and STAC Collection Summaries.", + "type": "object", + "required": [ + "stac_extensions" + ], + "properties": { + "stac_extensions": { + "type": "array", + "contains": { + "const": "https://stac-extensions.github.io/cmip6/v0.2.0/schema.json" + } + } + }, "oneOf": [ { "$comment": "This is the schema for STAC Items.", - "allOf": [ - { - "$ref": "#/definitions/stac_extensions" + "type": "object", + "required": [ + "type", + "properties" + ], + "properties": { + "type": { + "const": "Feature" }, - { - "type": "object", - "required": [ - "type", - "properties" - ], - "properties": { - "type": { - "const": "Feature" + "properties": { + "allOf": [ + { + "$ref": "#/definitions/require_any" }, - "properties": { - "allOf": [ - { - "$ref": "#/definitions/require_any_field" - }, - { - "$ref": "#/definitions/fields" - } - ] + { + "$ref": "#/definitions/fields" } - } + ] } - ] + } } ], "definitions": { - "stac_extensions": { - "type": "object", - "required": [ - "stac_extensions" - ], - "properties": { - "stac_extensions": { - "type": "array", - "contains": { - "const": "https://stac-extensions.github.io/cmip6/v1.0.0/schema.json" - } - } - } - }, - "require_any_field": { + "require_any": { "$comment": "Please list all fields here so that we can force the existence of one of them in other parts of the schemas.", "anyOf": [ { From 45bccddc3df92ce1e8bc5c3cc06c3dce1fa9f68d Mon Sep 17 00:00:00 2001 From: rhysrevans3 Date: Thu, 16 Jan 2025 12:39:58 +0000 Subject: [PATCH 2/4] Adding support for use with Collection. --- json-schema/schema.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/json-schema/schema.json b/json-schema/schema.json index 06e3560..a255cef 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -38,6 +38,22 @@ ] } } + }, + { + "$comment": "This is the schema for STAC Collections, or more specifically only Collection Summaries in this case. By default, only checks the existence of the properties, but not the schema of the summaries.", + "type": "object", + "required": [ + "type", + "summaries" + ], + "properties": { + "type": { + "const": "Collection" + }, + "summaries": { + "$ref": "#/definitions/require_any" + } + } } ], "definitions": { From cd7dd0d8c288d86226bb04241e9a31fb1b999f9b Mon Sep 17 00:00:00 2001 From: rhysrevans3 Date: Thu, 16 Jan 2025 12:41:27 +0000 Subject: [PATCH 3/4] Updating extension version in schema. --- json-schema/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/json-schema/schema.json b/json-schema/schema.json index a255cef..c944756 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -11,7 +11,7 @@ "stac_extensions": { "type": "array", "contains": { - "const": "https://stac-extensions.github.io/cmip6/v0.2.0/schema.json" + "const": "https://stac-extensions.github.io/cmip6/v1.0.0/schema.json" } } }, From 4ebc734ccb40ead2f9cc05f77e5f718b5128037b Mon Sep 17 00:00:00 2001 From: rhysrevans3 Date: Thu, 16 Jan 2025 12:53:52 +0000 Subject: [PATCH 4/4] Updating readme. --- .github/workflows/publish.yaml | 4 ++-- README.md | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 029974a..f8c2b71 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -7,10 +7,10 @@ jobs: runs-on: ubuntu-latest steps: - name: Inject env variables - uses: rlespinasse/github-slug-action@v4.4.1 + uses: rlespinasse/github-slug-action@v4 - uses: actions/checkout@v4 - name: deploy JSON Schema for version ${{ env.GITHUB_REF_SLUG }} - uses: peaceiris/actions-gh-pages@v3.9.3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: json-schema diff --git a/README.md b/README.md index 079717d..e4465ec 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ prefixed with `cmip6`. The fields in the table below can be used in these parts of STAC documents: - [ ] Catalogs -- [ ] Collections +- [x] Collections - [x] Item Properties (incl. Summaries in Collections) - [ ] Assets (for both Collections and Items, incl. Item Asset Definitions in Collections) - [ ] Links