diff --git a/examples/example-autzen.json b/examples/example-autzen.json index be33e91..1eef3be 100644 --- a/examples/example-autzen.json +++ b/examples/example-autzen.json @@ -374,7 +374,7 @@ "title": "USGS 3DEP LiDAR" }, "stac_extensions": [ - "https://stac-extensions.github.io/pointcloud/v1.0.0/schema.json" + "https://stac-extensions.github.io/pointcloud/v2.0.0/schema.json" ], "stac_version": "1.0.0", "type": "Feature" diff --git a/json-schema/schema.json b/json-schema/schema.json index 544b11e..4d3e5fa 100644 --- a/json-schema/schema.json +++ b/json-schema/schema.json @@ -1,97 +1,91 @@ { "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://stac-extensions.github.io/pointcloud/v1.0.0/schema.json#", + "$id": "https://stac-extensions.github.io/pointcloud/v2.0.0/schema.json#", "title": "Point Cloud Extension", "description": "STAC Point Cloud Extension for STAC Items and STAC Collections.", + "type": "object", + "required": [ + "stac_extensions" + ], + "properties": { + "stac_extensions": { + "type": "array", + "contains": { + "const": "https://stac-extensions.github.io/pointcloud/v2.0.0/schema.json" + } + } + }, "oneOf": [ { "$comment": "This is the schema for STAC Items.", - "allOf": [ - { + "type": "object", + "required": [ + "type", + "properties", + "assets" + ], + "properties": { + "type": { + "const": "Feature" + }, + "properties": { + "$ref": "#/definitions/fields" + }, + "assets": { "type": "object", - "required": [ - "type", - "properties", - "assets" - ], + "additionalProperties": { + "$ref": "#/definitions/fields" + } + } + }, + "anyOf": [ + { "properties": { - "type": { - "const": "Feature" - }, "properties": { - "allOf": [ - { - "$comment": "Require fields here for item properties.", - "required": [ - "pc:count", - "pc:type" - ] - }, - { - "$ref": "#/definitions/fields" - } - ] - }, - "assets": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/fields" - } + "$ref": "#/definitions/require_any" } } }, { - "$ref": "#/definitions/stac_extensions" + "$ref": "#/definitions/require_in_assets" } ] }, { "$comment": "This is the schema for STAC Collections.", - "allOf": [ + "type": "object", + "required": [ + "type" + ], + "properties": { + "type": { + "const": "Collection" + }, + "assets": { + "$ref": "#/definitions/fields" + }, + "item_assets": { + "$ref": "#/definitions/fields" + } + }, + "anyOf": [ + { + "$ref": "#/definitions/require_in_item_assets" + }, + { + "$ref": "#/definitions/require_in_assets" + }, { - "type": "object", - "required": [ - "type" - ], "properties": { - "type": { - "const": "Collection" - }, - "assets": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/fields" - } - }, - "item_assets": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/fields" - } + "summaries": { + "$ref": "#/definitions/require_any" } } - }, - { - "$ref": "#/definitions/stac_extensions" } ] } ], "definitions": { - "stac_extensions": { - "type": "object", - "required": [ - "stac_extensions" - ], - "properties": { - "stac_extensions": { - "type": "array", - "contains": { - "const": "https://stac-extensions.github.io/pointcloud/v1.0.0/schema.json" - } - } - } - }, "fields": { "type": "object", "properties": { @@ -122,6 +116,10 @@ } } }, + "required": [ + "count", + "type" + ], "patternProperties": { "^(?!pc:)": {} }, @@ -140,7 +138,8 @@ "minLength": 1 }, "size": { - "type": "integer" + "type": "integer", + "minimum": 0 }, "type": { "type": "string", diff --git a/package.json b/package.json index 496ebef..9894158 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stac-extensions", - "version": "1.0.0", + "version": "2.0.0", "scripts": { "test": "npm run check-markdown && npm run check-examples", "check-markdown": "remark . -f -r .github/remark.yaml", @@ -17,4 +17,4 @@ "remark-validate-links": "^10.0.0", "stac-node-validator": "^1.0.0" } -} +} \ No newline at end of file