Skip to content

Commit

Permalink
Publish JSON Schemas [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
STAC CI committed Aug 8, 2024
1 parent c712f39 commit 75e0196
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 64 deletions.
62 changes: 32 additions & 30 deletions dev/collection-spec/json-schema/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,40 +132,42 @@
"$ref": "../../item-spec/json-schema/item.json#/definitions/assets"
},
"item_assets": {
"allOf": [
{
"type": "object",
"minProperties": 2,
"properties": {
"href": {
"title": "Disallow href",
"not": {}
},
"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": {
"additionalProperties": {
"allOf": [
{
"type": "object",
"minProperties": 2,
"properties": {
"href": {
"title": "Disallow href",
"not": {}
},
"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": "../../item-spec/json-schema/common.json"
}
},
{
"$ref": "../../item-spec/json-schema/common.json"
}
]
]
}
},
"links": {
"$ref": "../../item-spec/json-schema/item.json#/definitions/links"
Expand Down
42 changes: 21 additions & 21 deletions dev/item-spec/json-schema/bands.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.stacspec.org/v1.1.0-beta.1/item-spec/json-schema/bands.json",
"title": "Bands Field",
"type": "object",
"properties": {
"bands": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"allOf": [
{
"$ref": "common.json"
}
]
}
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://schemas.stacspec.org/v1.1.0-beta.1/item-spec/json-schema/bands.json",
"title": "Bands Field",
"type": "object",
"properties": {
"bands": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"allOf": [
{
"$ref": "common.json"
}
]
}
}
}
}
}
20 changes: 7 additions & 13 deletions dev/item-spec/json-schema/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@
{
"$comment": "The if-then-else below checks whether the bands field is given in assets or not. If not, allows bands in properties (then), otherwise, disallows bands in properties (else).",
"if": {
"$comment": "If there is no asset with bands...",
"required": [
"assets"
],
Expand All @@ -187,27 +188,20 @@
}
},
"then": {
"$comment": "... then bands are not allowed in properties...",
"properties": {
"properties": {
"anyOf": [
{
"$ref": "bands.json"
},
{
"properties": {
"bands": false
}
}
]
"properties": {
"bands": false
}
}
}
},
"else": {
"$comment": "... otherwise bands are allowed in properties.",
"properties": {
"properties": {
"properties": {
"bands": false
}
"$ref": "bands.json"
}
}
}
Expand Down

0 comments on commit 75e0196

Please sign in to comment.