Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,34 @@ jobs:
- run:
name: validate
command: npm run check-markdown
publish_schemas:
working_directory: ~/stac
docker:
- image: circleci/node:12
steps:
- checkout
- run:
name: install
command: npm install
- add_ssh_keys:
fingerprints:
- "9b:0a:88:ff:12:d1:29:9a:ff:bb:72:ab:7d:81:df:59"
- run:
name: publish
command: npm run publish-schemas -- $CIRCLE_TAG
workflows:
version: 2
test:
ci:
jobs:
- test_examples
- test_docs
- test_docs
- publish_schemas:
requires:
- test_examples
filters:
tags:
# All (future) tags
only: /.+/
branches:
# Only dev branch, not PRs
only: dev
40 changes: 40 additions & 0 deletions .circleci/publish-schemas.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
const klaw = require('klaw-sync');
const path = require('path');
const fs = require('fs');
const ghpages = require('gh-pages');

function filterFn (item) {
const basename = path.basename(item.path);
return basename === '.' || basename === 'node_modules' || basename[0] !== '.';
}

let args = process.argv.slice(2);
let tag = 'dev';
if (args.length && args[0].trim().length > 0) {
tag = args[0];
}

var folder = '.';
var jsonSchemaFolderPattern = path.sep + 'json-schema' + path.sep;
for (let file of klaw(folder, {filter: filterFn})) {
if (file.path.includes(jsonSchemaFolderPattern) && path.extname(file.path) === '.json') {
let source = file.path;
let target = 'schemas' + path.sep + tag + path.sep + path.relative(folder, file.path);
fs.mkdirSync(path.dirname(target), { recursive: true });
fs.copyFileSync(source, target);
console.log(target);
}
}

ghpages.publish('schemas/' + tag, {
src: '**',
dest: tag,
message: 'Publish JSON Schemas [ci skip]',
user: {
name: 'STAC CI',
email: '[email protected]'
}
}, error => {
console.error(error ? error : 'Deployed to gh-pages');
process.exit(error ? 1 : 0);
});
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,6 @@ typings/
# IntelliJ IDEA files
.idea/
*.iml

# Folder created when CI puhlishes JSON Schemas
schemas/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Multiple extents (bounding boxes / intervals) are allowed per Collection

### Removed
- Validation instructions

### Fixed
- Fixed several JSON Schemas
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ the specification takes place in the [issue tracker](https://github.com/radiante

## In this Repository

This repository contains the core specifications plus examples and validation schemas and tools. Also included are a
This repository contains the core specifications plus examples and validation schemas. Also included are a
few documents that provide more context and plans for the evolution of the specification. Each spec folder contains a
README explaining the layout of the folder, the main specification document, examples, and validating schemas. And
there is one more specification in the STAC 'family', which is
Expand Down
4 changes: 0 additions & 4 deletions catalog-spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ contains a full sample catalog.
**Schemas:** The schemas to validate the core Catalog definition are found in the *[json-schema/](json-schema/)* folder.
The primary one is *[catalog.json](json-schema/catalog.json)*.

## Schema Validation

Instruction on schema validation for STAC Catalog can be found in the [validation instructions](../validation/README.md).

## Catalog Evolution

The Catalog specification is maturing, but it is still relatively early days. The core of Catalog has been defined very
Expand Down
2 changes: 1 addition & 1 deletion catalog-spec/json-schema/catalog.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "catalog.json#",
"$id": "https://schemas.stacspec.org/dev/catalog-spec/json-schema/catalog.json#",
"title": "STAC Catalog Specification",
"description": "This object represents Catalogs in a SpatioTemporal Asset Catalog.",
"allOf": [
Expand Down
4 changes: 0 additions & 4 deletions collection-spec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ structures and fields.
**Schemas:** The schemas to validate the STAC Collection definition are found in the
*[json-schema/](json-schema/)* folder. The primary one is *[collection.json](json-schema/collection.json)*.

## Schema Validation

Instruction on schema validation for STAC Items can be found in the [validation instructions](../validation/README.md).

## Collection Flexibility

STAC Collections are defined for flexibility. They only require a handful of fields, and
Expand Down
2 changes: 1 addition & 1 deletion collection-spec/collection-spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ STAC Collections are meant to be compatible with *OGC API - Features* Collection
* [Examples](examples/):
* Sentinel 2: A basic standalone example of a [Collection](examples/sentinel2.json) without items.
* Landsat 8: A [Collection](examples/landsat-collection.json) with corresponding Item [Item](../item-spec/examples/landsat8-sample.json).
* [JSON Schema](json-schema/collection.json) - please see the [validation instructions](../validation/README.md)
* [JSON Schema](json-schema/collection.json)

## Collection fields

Expand Down
2 changes: 1 addition & 1 deletion collection-spec/json-schema/collection.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "collection.json#",
"$id": "https://schemas.stacspec.org/dev/collection-spec/json-schema/collection.json#",
"title": "STAC Collection Specification",
"description": "This object represents Collections in a SpatioTemporal Asset Catalog.",
"allOf": [
Expand Down
7 changes: 5 additions & 2 deletions extensions/checksum/json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json#",
"$id": "https://schemas.stacspec.org/dev/extensions/checksum/json-schema/schema.json#",
"title": "Checksum Extension Specification",
"description": "STAC Checksum Extension to a STAC Item",
"oneOf": [
Expand Down Expand Up @@ -60,7 +60,10 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "checksum"
"enum": [
"checksum",
"https://schemas.stacspec.org/dev/extensions/checksum/json-schema/schema.json"
]
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions extensions/collection-assets/json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json#",
"$id": "https://schemas.stacspec.org/dev/extensions/collection-assets/json-schema/schema.json#",
"title": "Collection Assets Extension Specification",
"description": "STAC Collection-level assets Extension to a STAC Collection",
"allOf": [
Expand All @@ -17,7 +17,10 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "collection-assets"
"enum": [
"collection-assets",
"https://schemas.stacspec.org/dev/extensions/collection-assets/json-schema/schema.json"
]
}
},
"assets": {
Expand Down
7 changes: 5 additions & 2 deletions extensions/datacube/json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json#",
"$id": "https://schemas.stacspec.org/dev/extensions/datacube/json-schema/schema.json#",
"title": "Data Cube Extension",
"description": "STAC Data Cube Extension to STAC Items and STAC Collections",
"oneOf": [
Expand Down Expand Up @@ -49,7 +49,10 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "datacube"
"enum": [
"datacube",
"https://schemas.stacspec.org/dev/extensions/datacube/json-schema/schema.json"
]
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions extensions/eo/json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json#",
"$id": "https://schemas.stacspec.org/dev/extensions/eo/json-schema/schema.json#",
"title": "EO Extension",
"description": "STAC EO Extension to a STAC Item.",
"allOf": [
Expand All @@ -23,7 +23,10 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "eo"
"enum": [
"eo",
"https://schemas.stacspec.org/dev/extensions/eo/json-schema/schema.json"
]
}
},
"properties": {
Expand Down
7 changes: 5 additions & 2 deletions extensions/item-assets/json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json#",
"$id": "https://schemas.stacspec.org/dev/extensions/item-assets/json-schema/schema.json#",
"title": "Asset Definition Extension Specification",
"description": "STAC Asset Definition Extension to a STAC Collection",
"allOf": [
Expand All @@ -23,7 +23,10 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "item-assets"
"enum": [
"item-assets",
"https://schemas.stacspec.org/dev/extensions/item-assets/json-schema/schema.json"
]
}
},
"item_assets": {
Expand Down
7 changes: 5 additions & 2 deletions extensions/label/json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json#",
"$id": "https://schemas.stacspec.org/dev/extensions/label/json-schema/schema.json#",
"title": "Label Extension",
"description": "STAC Label Data Item Extension Spec",
"allOf": [
Expand All @@ -22,7 +22,10 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "label"
"enum": [
"label",
"https://schemas.stacspec.org/dev/extensions/label/json-schema/schema.json"
]
}
},
"properties": {
Expand Down
7 changes: 5 additions & 2 deletions extensions/projection/json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema":"http://json-schema.org/draft-07/schema#",
"$id":"schema.json#",
"$id":"https://schemas.stacspec.org/dev/extensions/projection/json-schema/schema.json#",
"title":"Projection Extension",
"description":"STAC Projection Extension to a STAC Item",
"allOf":[
Expand All @@ -22,7 +22,10 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "projection"
"enum": [
"projection",
"https://schemas.stacspec.org/dev/extensions/projection/json-schema/schema.json"
]
}
},
"properties":{
Expand Down
7 changes: 5 additions & 2 deletions extensions/sar/json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json#",
"$id": "https://schemas.stacspec.org/dev/extensions/sar/json-schema/schema.json#",
"title": "SAR Extension",
"description": "STAC SAR Extension to a STAC Item",
"allOf": [
Expand All @@ -23,7 +23,10 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "sar"
"enum": [
"sar",
"https://schemas.stacspec.org/dev/extensions/sar/json-schema/schema.json"
]
}
},
"properties": {
Expand Down
7 changes: 5 additions & 2 deletions extensions/sat/json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json#",
"$id": "https://schemas.stacspec.org/dev/extensions/sat/json-schema/schema.json#",
"title": "Sat Extension",
"description": "STAC Sat Extension to a STAC Item.",
"allOf": [
Expand All @@ -25,7 +25,10 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "sat"
"enum": [
"sat",
"https://schemas.stacspec.org/dev/extensions/sat/json-schema/schema.json"
]
}
},
"properties": {
Expand Down
7 changes: 5 additions & 2 deletions extensions/scientific/json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json#",
"$id": "https://stacspec.org/schemas/v1.0.0-beta.1/extensions/scientific/json-schema/schema.json#",
"title": "Scientific Extension",
"description": "STAC Scientific Extension to STAC Items or STAC Collections.",
"oneOf": [
Expand Down Expand Up @@ -49,7 +49,10 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "scientific"
"enum": [
"scientific",
"https://schemas.stacspec.org/dev/extensions/scientific/json-schema/schema.json"
]
}
}
}
Expand Down
7 changes: 5 additions & 2 deletions extensions/single-file-stac/json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "schema.json#",
"$id": "https://schemas.stacspec.org/dev/extensions/single-file-stac/json-schema/schema.json#",
"title": "Single File STAC Extension",
"description": "Single File STAC Extension to combine Collections and Items in single file catalog",
"allOf": [
Expand All @@ -25,7 +25,10 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "single-file-stac"
"enum": [
"single-file-stac",
"https://schemas.stacspec.org/dev/extensions/single-file-stac/json-schema/schema.json"
]
}
},
"collections": {
Expand Down
7 changes: 5 additions & 2 deletions extensions/tiled-assets/json-schema/schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "stac-extension-tiled-assets.json#",
"$id": "https://schemas.stacspec.org/dev/extensions/tiled-assets/json-schema/schema.json#",
"title": "Tiled Assets Extension",
"description": "Tiled Assets Extension to a STAC Item",
"oneOf": [
Expand Down Expand Up @@ -52,7 +52,10 @@
"stac_extensions": {
"type": "array",
"contains": {
"const": "tiled-assets"
"enum": [
"tiled-assets",
"https://schemas.stacspec.org/dev/extensions/tiled-assets/json-schema/schema.json"
]
}
}
}
Expand Down
Loading