Skip to content

Commit

Permalink
Update JSON schema
Browse files Browse the repository at this point in the history
  • Loading branch information
duckontheweb committed Apr 29, 2021
1 parent 978305b commit 81e18a4
Showing 1 changed file with 8 additions and 77 deletions.
85 changes: 8 additions & 77 deletions json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://stac-extensions.github.io/template/v1.0.0/schema.json#",
"title": "Template Extension",
"description": "STAC Template Extension for STAC Items and STAC Collections.",
"$id": "https://stac-extensions.github.io/ml-aoi/v1.0.0/schema.json#",
"title": "ML AOI Extension",
"description": "ML AOI Extension for STAC Items.",
"oneOf": [
{
"$comment": "This is the schema for STAC Items. Remove this object if this extension only applies to Collections.",
"allOf": [
{
"type": "object",
Expand All @@ -20,12 +19,6 @@
},
"properties": {
"allOf": [
{
"$comment": "Require fields here for item properties.",
"required": [
"template:new_field"
]
},
{
"$ref": "#/definitions/fields"
}
Expand All @@ -43,41 +36,6 @@
"$ref": "#/definitions/stac_extensions"
}
]
},
{
"$comment": "This is the schema for STAC Collections. Remove this object if this extension does not define top-level fields for Collections AND can't be used in collection assets or item asset defintions.",
"allOf": [
{
"type": "object",
"required": [
"type"
],
"properties": {
"type": {
"const": "Collection"
},
"assets": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/fields"
}
},
"item_assets": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/fields"
}
}
}
},
{
"$ref": "#/definitions/stac_extensions"
},
{
"$comment": "Remove this object if this extension does not define top-level fields for Collections.",
"$ref": "#/definitions/fields"
}
]
}
],
"definitions": {
Expand All @@ -90,48 +48,21 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "https://stac-extensions.github.io/template/v1.0.0/schema.json"
"const": "https://stac-extensions.github.io/ml-aoi/v1.0.0/schema.json"
}
}
}
},
"fields": {
"$comment": "Add your new fields here. Don't require them here, do that above in the item schema.",
"type": "object",
"properties": {
"template:new_field": {
"type": "string"
},
"template:xyz": {
"type": "object",
"required": [
"x",
"y",
"z"
],
"properties": {
"x": {
"type": "number"
},
"y": {
"type": "number"
},
"z": {
"type": "number"
}
}
},
"template:another_one": {
"type": "array",
"items": {
"type": "number"
}
"ml-aoi:split": {
"type": "string",
"enum": ["train", "test", "validate"]
}
},
"patternProperties": {
"^(?!template:)": {
"$comment": "Above, change `template` to the prefix of this extension"
}
"^(?!ml-aoi:)": {}
},
"additionalProperties": false
}
Expand Down

0 comments on commit 81e18a4

Please sign in to comment.