From d82c59924c94ebf6d0b5a3e092057fe3c93f77b2 Mon Sep 17 00:00:00 2001 From: smohiudd Date: Thu, 19 Dec 2024 14:29:04 -0700 Subject: [PATCH 1/5] update json schema --- FormSchemas/jsonschema.json | 146 ++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) diff --git a/FormSchemas/jsonschema.json b/FormSchemas/jsonschema.json index a0f8c60..e51a11a 100644 --- a/FormSchemas/jsonschema.json +++ b/FormSchemas/jsonschema.json @@ -91,6 +91,28 @@ "items": { "type": "object", "properties": { + "upload": { + "type": "boolean", + "title": "Upload", + "default": false + }, + "cogify": { + "type": "boolean", + "title": "Cogify", + "default": false + }, + "dry_run": { + "type": "boolean", + "title": "Dry Run", + "default": false + }, + "discovery": { + "type": "string", + "enum": [ + "s3" + ], + "title": "Discovery" + }, "prefix": { "type": "string", "title": "Prefix" @@ -98,6 +120,43 @@ "bucket": { "type": "string", "title": "Bucket" + }, + "filename_regex": { + "type": "string", + "title": "Filename Regex", + "default": "[\\s\\S]*" + }, + "datetime_range": { + "type": "string", + "title": "Datetime Range" + }, + "start_datetime": { + "type": "string", + "format": "date-time", + "title": "Start Datetime" + }, + "end_datetime": { + "type": "string", + "format": "date-time", + "title": "End Datetime" + }, + "single_datetime": { + "type": "string", + "format": "date-time", + "title": "Single Datetime" + }, + "id_regex": { + "type": "string", + "title": "Id Regex" + }, + "id_template": { + "type": "string", + "title": "Id Template" + }, + "use_multithreading":{ + "type": "string", + "title": "Use Multithreading", + "default": "false" } }, "required": ["prefix", "bucket"] @@ -122,6 +181,93 @@ "items": { "type": "string" } + }, + "item_assets": { + "type": "object", + "title": "Item Assets", + "properties": { + "cog_default": { + "type": "object", + "properties": { + "type": { + "type": "string", + "default":"image/tiff; application=geotiff; profile=cloud-optimized" + }, + "roles": { + "type": "array", + "items": [ + { + "type": "string" + } + ], + "default":[ + "data", + "layer" + ] + }, + "title": { + "type": "string", + "default":"Default COG Layer" + }, + "description": { + "type": "string", + "default":"Cloud optimized default layer to display on map" + } + }, + "required": [ + "type", + "roles", + "title", + "description" + ] + } + }, + "required": [ + "cog_default" + ] + }, + "renders": { + "type": "object", + "title": "Renders" + }, + "providers": { + "title": "Providers", + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "title": "Organization name", + "type": "string", + "minLength": 1 + }, + "description": { + "title": "Organization description", + "type": "string" + }, + "roles": { + "title": "Organization roles", + "type": "array", + "items": { + "type": "string", + "enum": [ + "producer", + "licensor", + "processor", + "host" + ] + } + }, + "url": { + "title": "Organization homepage", + "type": "string", + "format": "iri" + } + } + } } } } From 1c846331de48d5cdab5eb000bf0e7c19c1fe5888 Mon Sep 17 00:00:00 2001 From: smohiudd Date: Thu, 19 Dec 2024 14:34:16 -0700 Subject: [PATCH 2/5] add assets to json schema --- FormSchemas/jsonschema.json | 41 ++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/FormSchemas/jsonschema.json b/FormSchemas/jsonschema.json index e51a11a..314bcdf 100644 --- a/FormSchemas/jsonschema.json +++ b/FormSchemas/jsonschema.json @@ -9,7 +9,9 @@ "spatial_extent", "temporal_extent", "sample_files", - "data_type" + "data_type", + "providers", + "item_assets" ], "properties": { "collection": { "type": "string", "title": "Collection" }, @@ -268,6 +270,43 @@ } } } + }, + "assets": { + "type": "object", + "properties": { + "thumbnail": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "href": { + "type": "string" + }, + "type": { + "type": "string" + }, + "roles": { + "type": "array", + "items": [ + { + "type": "string" + } + ] + } + }, + "required": [ + "title", + "description", + "href", + "type", + "roles" + ] + } + } } } } From a884f9ed880bcff33fd6c05243ae9f2446ac783f Mon Sep 17 00:00:00 2001 From: Stephen Kilbourn Date: Thu, 19 Dec 2024 16:54:00 -0700 Subject: [PATCH 3/5] add new vields to ui schema --- FormSchemas/uischema.json | 92 ++++++++++++++++++++++++++++++++++++--- app/globals.css | 7 ++- 2 files changed, 91 insertions(+), 8 deletions(-) diff --git a/FormSchemas/uischema.json b/FormSchemas/uischema.json index ca96835..d0b06fd 100644 --- a/FormSchemas/uischema.json +++ b/FormSchemas/uischema.json @@ -14,12 +14,23 @@ "temporal_extent": 6 }, { - "sample_files": 8, - "discovery_items": 8, - "stac_extensions": 8 + "discovery_items": 24 + }, + { + "sample_files": 12, + "stac_extensions": 12 }, { "links": 24 + }, + { + "item_assets": 24 + }, + { + "providers": 24 + }, + { + "assets":24 } ], "spatial_extent": { @@ -36,10 +47,34 @@ }, "discovery_items": { "items": { - "ui-grid": [ + "ui:grid": [ { - "prefix": 12, - "bucket": 12 + "upload": 8, + "cogify": 8, + "dry_run": 8 + }, + { + "discovery": 8, + "prefix": 8, + "bucket": 8 + }, + { + "filename_regex": 12, + "datetime_range": 12 + }, + { + "stac_extensions": 12, + "links": 12 + }, + { + "start_datetime": 8, + "end_datetime": 8, + "single_datetime": 8 + }, + { + "id_regex": 8, + "id_template": 8, + "use_multithreading": 8 } ] } @@ -61,6 +96,49 @@ ] } }, + "item_assets": { + "cog_default": { + "ui:grid": [ + { + "type": 12, + "roles": 12 + }, + { + "title": 12, + "description": 12 + } + ] + } + }, + "providers": { + "items": { + "ui:grid": [ + { + "name": 12, + "description": 12 + }, + { + "roles": 12, + "url": 12 + } + ] + } + }, + "assets": { + "thumbnail": { + "ui:grid": [ + { + "title": 12, + "description": 12 + }, + { + "href": 8, + "type": 8, + "roles": 8 + } + ] + } + }, "description": { "ui:widget": "textarea", "ui:options": { @@ -75,4 +153,4 @@ "block": "true" } } -} +} \ No newline at end of file diff --git a/app/globals.css b/app/globals.css index a08f369..71feb6e 100644 --- a/app/globals.css +++ b/app/globals.css @@ -87,7 +87,12 @@ main > div { #root_spatial_extent, #root_temporal_extent, #root_discovery_items fieldset, -#root_links fieldset { +#root_links fieldset, +#root_item_assets, +#root_item_assets fieldset, +#root_providers fieldset, +#root_assets, +#root_assets fieldset { padding: 6px 6px; border-radius: 6px; border: none; From 6e3bfd0535fd11951f3d04e94e5470940d3d42cd Mon Sep 17 00:00:00 2001 From: Stephen Kilbourn Date: Fri, 20 Dec 2024 11:00:16 -0700 Subject: [PATCH 4/5] try parsing render schema --- FormSchemas/jsonschema.json | 602 ++++++++++++++------------- FormSchemas/uischema.json | 3 + components/IngestForm.tsx | 23 +- package.json | 1 + public/FormSchemas/jsonschema.json | 334 +++++++++++++++ public/FormSchemas/renderSchema.json | 285 +++++++++++++ yarn.lock | 14 + 7 files changed, 969 insertions(+), 293 deletions(-) create mode 100644 public/FormSchemas/jsonschema.json create mode 100644 public/FormSchemas/renderSchema.json diff --git a/FormSchemas/jsonschema.json b/FormSchemas/jsonschema.json index 314bcdf..ca74c1b 100644 --- a/FormSchemas/jsonschema.json +++ b/FormSchemas/jsonschema.json @@ -1,312 +1,334 @@ { - "type": "object", - "required": [ - "collection", - "title", - "description", - "license", - "discovery_items", - "spatial_extent", - "temporal_extent", - "sample_files", - "data_type", - "providers", - "item_assets" - ], - "properties": { - "collection": { "type": "string", "title": "Collection" }, - "title": { "type": "string", "title": "Title" }, - "description": { "type": "string", "title": "Description" }, - "license": { "type": "string", "title": "License" }, - "dashboard:is_periodic": { "type": "boolean", "title": "Is Periodic?" }, - "dashboard:time_density": { "type": "string", "title": "Time Density" }, - "links": { - "title": "Links", - "type": "array", - "items": { - "type": "object", - "properties": { - "href": { + "type": "object", + "required": [ + "collection", + "title", + "description", + "license", + "discovery_items", + "spatial_extent", + "temporal_extent", + "sample_files", + "data_type", + "providers", + "item_assets" + ], + "properties": { + "collection": { "type": "string", - "title": "href" - }, - "rel": { + "title": "Collection" + }, + "title": { "type": "string", - "title": "rel" - }, - "type": { + "title": "Title" + }, + "description": { "type": "string", - "title": "type" - }, - "title": { + "title": "Description" + }, + "license": { "type": "string", - "title": "title" - }, - "label:assets": { + "title": "License" + }, + "dashboard:is_periodic": { + "type": "boolean", + "title": "Is Periodic?" + }, + "dashboard:time_density": { "type": "string", - "title": "label:assets" - } - } - } - }, - "spatial_extent": { - "title": "Spatial Extent", - "type": "object", - "properties": { - "xmin": { - "type": "number", - "title": "xmin" + "title": "Time Density" }, - "ymin": { - "type": "number", - "title": "ymin" + "links": { + "title": "Links", + "type": "array", + "items": { + "type": "object", + "properties": { + "href": { + "type": "string", + "title": "href" + }, + "rel": { + "type": "string", + "title": "rel" + }, + "type": { + "type": "string", + "title": "type" + }, + "title": { + "type": "string", + "title": "title" + }, + "label:assets": { + "type": "string", + "title": "label:assets" + } + } + } }, - "xmax": { - "type": "number", - "title": "xmax" + "spatial_extent": { + "title": "Spatial Extent", + "type": "object", + "properties": { + "xmin": { + "type": "number", + "title": "xmin" + }, + "ymin": { + "type": "number", + "title": "ymin" + }, + "xmax": { + "type": "number", + "title": "xmax" + }, + "ymax": { + "type": "number", + "title": "ymax" + } + } }, - "ymax": { - "type": "number", - "title": "ymax" - } - } - }, - "temporal_extent": { - "title": "Temporal Extent", - "type": "object", - "properties": { - "startdate": { - "type": "string", - "format": "date", - "title": "Start Date" + "temporal_extent": { + "title": "Temporal Extent", + "type": "object", + "properties": { + "startdate": { + "type": "string", + "format": "date", + "title": "Start Date" + }, + "enddate": { + "type": "string", + "format": "date", + "title": "End Date" + } + } }, - "enddate": { - "type": "string", - "format": "date", - "title": "End Date" - } - } - }, - "discovery_items": { - "type": "array", - "title": "Discovery Items", - "items": { - "type": "object", - "properties": { - "upload": { - "type": "boolean", - "title": "Upload", - "default": false - }, - "cogify": { - "type": "boolean", - "title": "Cogify", - "default": false - }, - "dry_run": { - "type": "boolean", - "title": "Dry Run", - "default": false - }, - "discovery": { - "type": "string", - "enum": [ - "s3" - ], - "title": "Discovery" - }, - "prefix": { - "type": "string", - "title": "Prefix" - }, - "bucket": { - "type": "string", - "title": "Bucket" - }, - "filename_regex": { - "type": "string", - "title": "Filename Regex", - "default": "[\\s\\S]*" - }, - "datetime_range": { - "type": "string", - "title": "Datetime Range" - }, - "start_datetime": { - "type": "string", - "format": "date-time", - "title": "Start Datetime" - }, - "end_datetime": { - "type": "string", - "format": "date-time", - "title": "End Datetime" - }, - "single_datetime": { - "type": "string", - "format": "date-time", - "title": "Single Datetime" - }, - "id_regex": { - "type": "string", - "title": "Id Regex" - }, - "id_template": { - "type": "string", - "title": "Id Template" - }, - "use_multithreading":{ - "type": "string", - "title": "Use Multithreading", - "default": "false" - } + "discovery_items": { + "type": "array", + "title": "Discovery Items", + "items": { + "type": "object", + "properties": { + "upload": { + "type": "boolean", + "title": "Upload", + "default": false + }, + "cogify": { + "type": "boolean", + "title": "Cogify", + "default": false + }, + "dry_run": { + "type": "boolean", + "title": "Dry Run", + "default": false + }, + "discovery": { + "type": "string", + "enum": [ + "s3" + ], + "title": "Discovery" + }, + "prefix": { + "type": "string", + "title": "Prefix" + }, + "bucket": { + "type": "string", + "title": "Bucket" + }, + "filename_regex": { + "type": "string", + "title": "Filename Regex", + "default": "[\\s\\S]*" + }, + "datetime_range": { + "type": "string", + "title": "Datetime Range" + }, + "start_datetime": { + "type": "string", + "format": "date-time", + "title": "Start Datetime" + }, + "end_datetime": { + "type": "string", + "format": "date-time", + "title": "End Datetime" + }, + "single_datetime": { + "type": "string", + "format": "date-time", + "title": "Single Datetime" + }, + "id_regex": { + "type": "string", + "title": "Id Regex" + }, + "id_template": { + "type": "string", + "title": "Id Template" + }, + "use_multithreading": { + "type": "string", + "title": "Use Multithreading", + "default": "false" + } + }, + "required": [ + "prefix", + "bucket" + ] + }, + "minItems": 1 }, - "required": ["prefix", "bucket"] - }, - "minItems": 1 - }, - "sample_files": { - "title": "Sample Files", - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - }, - "data_type": { - "title": "Data Type", - "const": "cog" - }, - "stac_extensions": { - "title": "STAC Extensions", - "type": "array", - "items": { - "type": "string" - } - }, - "item_assets": { - "type": "object", - "title": "Item Assets", - "properties": { - "cog_default": { - "type": "object", - "properties": { - "type": { - "type": "string", - "default":"image/tiff; application=geotiff; profile=cloud-optimized" - }, - "roles": { + "sample_files": { + "title": "Sample Files", "type": "array", - "items": [ - { + "items": { "type": "string" - } - ], - "default":[ - "data", - "layer" - ] - }, - "title": { - "type": "string", - "default":"Default COG Layer" - }, - "description": { - "type": "string", - "default":"Cloud optimized default layer to display on map" - } + }, + "minItems": 1 }, - "required": [ - "type", - "roles", - "title", - "description" - ] - } - }, - "required": [ - "cog_default" - ] - }, - "renders": { - "type": "object", - "title": "Renders" - }, - "providers": { - "title": "Providers", - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "title": "Organization name", - "type": "string", - "minLength": 1 - }, - "description": { - "title": "Organization description", - "type": "string" - }, - "roles": { - "title": "Organization roles", + "data_type": { + "title": "Data Type", + "const": "cog" + }, + "stac_extensions": { + "title": "STAC Extensions", "type": "array", "items": { - "type": "string", - "enum": [ - "producer", - "licensor", - "processor", - "host" - ] + "type": "string" } - }, - "url": { - "title": "Organization homepage", - "type": "string", - "format": "iri" - } - } - } - }, - "assets": { - "type": "object", - "properties": { - "thumbnail": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "href": { - "type": "string" - }, - "type": { - "type": "string" + }, + "item_assets": { + "type": "object", + "title": "Item Assets", + "properties": { + "cog_default": { + "type": "object", + "properties": { + "type": { + "type": "string", + "default": "image/tiff; application=geotiff; profile=cloud-optimized" + }, + "roles": { + "type": "array", + "items": [ + { + "type": "string" + } + ], + "default": [ + "data", + "layer" + ] + }, + "title": { + "type": "string", + "default": "Default COG Layer" + }, + "description": { + "type": "string", + "default": "Cloud optimized default layer to display on map" + } + }, + "required": [ + "type", + "roles", + "title", + "description" + ] + } }, - "roles": { - "type": "array", - "items": [ - { - "type": "string" + "required": [ + "cog_default" + ] + }, + "renders": { + "title": "Renders", + "type": "object", + "$ref": "./renderSchema.json" + }, + "providers": { + "title": "Providers", + "type": "array", + "items": { + "type": "object", + "required": [ + "name" + ], + "properties": { + "name": { + "title": "Organization name", + "type": "string", + "minLength": 1 + }, + "description": { + "title": "Organization description", + "type": "string" + }, + "roles": { + "title": "Organization roles", + "type": "array", + "items": { + "type": "string", + "enum": [ + "producer", + "licensor", + "processor", + "host" + ] + } + }, + "url": { + "title": "Organization homepage", + "type": "string", + "format": "iri" + } + } + } + }, + "assets": { + "type": "object", + "properties": { + "thumbnail": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "href": { + "type": "string" + }, + "type": { + "type": "string" + }, + "roles": { + "type": "array", + "items": [ + { + "type": "string" + } + ] + } + }, + "required": [ + "title", + "description", + "href", + "type", + "roles" + ] } - ] } - }, - "required": [ - "title", - "description", - "href", - "type", - "roles" - ] } - } } - } -} +} \ No newline at end of file diff --git a/FormSchemas/uischema.json b/FormSchemas/uischema.json index d0b06fd..bd5206b 100644 --- a/FormSchemas/uischema.json +++ b/FormSchemas/uischema.json @@ -29,6 +29,9 @@ { "providers": 24 }, + { + "renders": 24 + }, { "assets":24 } diff --git a/components/IngestForm.tsx b/components/IngestForm.tsx index b5720b2..57a6f15 100644 --- a/components/IngestForm.tsx +++ b/components/IngestForm.tsx @@ -1,6 +1,6 @@ 'use client'; -import { FormEvent, SetStateAction } from 'react'; +import { FormEvent, SetStateAction, useEffect, useState } from 'react'; import { IChangeEvent, withTheme } from '@rjsf/core'; import { Theme as AntDTheme } from '@rjsf/antd'; @@ -9,8 +9,8 @@ import validator from '@rjsf/validator-ajv8'; import { JSONSchema7 } from 'json-schema'; import ObjectFieldTemplate from '../ObjectFieldTemplate'; -import jsonSchema from '@/FormSchemas/jsonschema.json'; import { RJSFSchema, UiSchema } from '@rjsf/utils'; +import $RefParser from "@apidevtools/json-schema-ref-parser"; const Form = withTheme(AntDTheme); @@ -32,6 +32,23 @@ function IngestForm({ onSubmit, children, }: FormProps) { + const [schema, setSchema] = useState({}); + + useEffect(() => { + const fetchSchema = async () => { + try { + const parser = new $RefParser(); + const dereferencedSchema = await parser.dereference('/FormSchemas/jsonschema.json'); + console.log('dereferencedSchema', dereferencedSchema) + setSchema(dereferencedSchema); + } catch (error) { + console.error(error); + } + }; + + fetchSchema(); + }, []); + const onFormDataChanged = (formState: { formData: SetStateAction; }) => { @@ -41,7 +58,7 @@ function IngestForm({ return (
Date: Fri, 20 Dec 2024 11:28:40 -0700 Subject: [PATCH 5/5] make renders a text area --- FormSchemas/jsonschema.json | 13 +- FormSchemas/uischema.json | 8 + app/globals.css | 1 + public/FormSchemas/jsonschema.json | 334 --------------------------- public/FormSchemas/renderSchema.json | 285 ----------------------- 5 files changed, 18 insertions(+), 623 deletions(-) delete mode 100644 public/FormSchemas/jsonschema.json delete mode 100644 public/FormSchemas/renderSchema.json diff --git a/FormSchemas/jsonschema.json b/FormSchemas/jsonschema.json index ca74c1b..cf0d183 100644 --- a/FormSchemas/jsonschema.json +++ b/FormSchemas/jsonschema.json @@ -174,9 +174,9 @@ "title": "Id Template" }, "use_multithreading": { - "type": "string", + "type": "boolean", "title": "Use Multithreading", - "default": "false" + "default": false } }, "required": [ @@ -220,7 +220,7 @@ "type": "array", "items": [ { - "type": "string" + "type": "string" } ], "default": [ @@ -252,7 +252,12 @@ "renders": { "title": "Renders", "type": "object", - "$ref": "./renderSchema.json" + "properties": { + "renders_object": { + "type": "string", + "title": "Renders Object" + } + } }, "providers": { "title": "Providers", diff --git a/FormSchemas/uischema.json b/FormSchemas/uischema.json index bd5206b..7d72b91 100644 --- a/FormSchemas/uischema.json +++ b/FormSchemas/uischema.json @@ -148,6 +148,14 @@ "rows": 2 } }, + "renders": { + "renders_object": { + "ui:widget": "textarea", + "ui:options": { + "rows": 12 + } + } + }, "ui:submitButtonOptions": { "props": { "color": "primary", diff --git a/app/globals.css b/app/globals.css index 71feb6e..a31878b 100644 --- a/app/globals.css +++ b/app/globals.css @@ -91,6 +91,7 @@ main > div { #root_item_assets, #root_item_assets fieldset, #root_providers fieldset, +#root_renders, #root_assets, #root_assets fieldset { padding: 6px 6px; diff --git a/public/FormSchemas/jsonschema.json b/public/FormSchemas/jsonschema.json deleted file mode 100644 index e0b826b..0000000 --- a/public/FormSchemas/jsonschema.json +++ /dev/null @@ -1,334 +0,0 @@ -{ - "type": "object", - "required": [ - "collection", - "title", - "description", - "license", - "discovery_items", - "spatial_extent", - "temporal_extent", - "sample_files", - "data_type", - "providers", - "item_assets" - ], - "properties": { - "collection": { - "type": "string", - "title": "Collection" - }, - "title": { - "type": "string", - "title": "Title" - }, - "description": { - "type": "string", - "title": "Description" - }, - "license": { - "type": "string", - "title": "License" - }, - "dashboard:is_periodic": { - "type": "boolean", - "title": "Is Periodic?" - }, - "dashboard:time_density": { - "type": "string", - "title": "Time Density" - }, - "links": { - "title": "Links", - "type": "array", - "items": { - "type": "object", - "properties": { - "href": { - "type": "string", - "title": "href" - }, - "rel": { - "type": "string", - "title": "rel" - }, - "type": { - "type": "string", - "title": "type" - }, - "title": { - "type": "string", - "title": "title" - }, - "label:assets": { - "type": "string", - "title": "label:assets" - } - } - } - }, - "spatial_extent": { - "title": "Spatial Extent", - "type": "object", - "properties": { - "xmin": { - "type": "number", - "title": "xmin" - }, - "ymin": { - "type": "number", - "title": "ymin" - }, - "xmax": { - "type": "number", - "title": "xmax" - }, - "ymax": { - "type": "number", - "title": "ymax" - } - } - }, - "temporal_extent": { - "title": "Temporal Extent", - "type": "object", - "properties": { - "startdate": { - "type": "string", - "format": "date", - "title": "Start Date" - }, - "enddate": { - "type": "string", - "format": "date", - "title": "End Date" - } - } - }, - "discovery_items": { - "type": "array", - "title": "Discovery Items", - "items": { - "type": "object", - "properties": { - "upload": { - "type": "boolean", - "title": "Upload", - "default": false - }, - "cogify": { - "type": "boolean", - "title": "Cogify", - "default": false - }, - "dry_run": { - "type": "boolean", - "title": "Dry Run", - "default": false - }, - "discovery": { - "type": "string", - "enum": [ - "s3" - ], - "title": "Discovery" - }, - "prefix": { - "type": "string", - "title": "Prefix" - }, - "bucket": { - "type": "string", - "title": "Bucket" - }, - "filename_regex": { - "type": "string", - "title": "Filename Regex", - "default": "[\\s\\S]*" - }, - "datetime_range": { - "type": "string", - "title": "Datetime Range" - }, - "start_datetime": { - "type": "string", - "format": "date-time", - "title": "Start Datetime" - }, - "end_datetime": { - "type": "string", - "format": "date-time", - "title": "End Datetime" - }, - "single_datetime": { - "type": "string", - "format": "date-time", - "title": "Single Datetime" - }, - "id_regex": { - "type": "string", - "title": "Id Regex" - }, - "id_template": { - "type": "string", - "title": "Id Template" - }, - "use_multithreading": { - "type": "string", - "title": "Use Multithreading", - "default": "false" - } - }, - "required": [ - "prefix", - "bucket" - ] - }, - "minItems": 1 - }, - "sample_files": { - "title": "Sample Files", - "type": "array", - "items": { - "type": "string" - }, - "minItems": 1 - }, - "data_type": { - "title": "Data Type", - "const": "cog" - }, - "stac_extensions": { - "title": "STAC Extensions", - "type": "array", - "items": { - "type": "string" - } - }, - "item_assets": { - "type": "object", - "title": "Item Assets", - "properties": { - "cog_default": { - "type": "object", - "properties": { - "type": { - "type": "string", - "default": "image/tiff; application=geotiff; profile=cloud-optimized" - }, - "roles": { - "type": "array", - "items": [ - { - "type": "string" - } - ], - "default": [ - "data", - "layer" - ] - }, - "title": { - "type": "string", - "default": "Default COG Layer" - }, - "description": { - "type": "string", - "default": "Cloud optimized default layer to display on map" - } - }, - "required": [ - "type", - "roles", - "title", - "description" - ] - } - }, - "required": [ - "cog_default" - ] - }, - "renders": { - "title": "Renders", - "type": "object", - "$ref": "./renderSchema.json" - }, - "providers": { - "title": "Providers", - "type": "array", - "items": { - "type": "object", - "required": [ - "name" - ], - "properties": { - "name": { - "title": "Organization name", - "type": "string", - "minLength": 1 - }, - "description": { - "title": "Organization description", - "type": "string" - }, - "roles": { - "title": "Organization roles", - "type": "array", - "items": { - "type": "string", - "enum": [ - "producer", - "licensor", - "processor", - "host" - ] - } - }, - "url": { - "title": "Organization homepage", - "type": "string", - "format": "iri" - } - } - } - }, - "assets": { - "type": "object", - "properties": { - "thumbnail": { - "type": "object", - "properties": { - "title": { - "type": "string" - }, - "description": { - "type": "string" - }, - "href": { - "type": "string" - }, - "type": { - "type": "string" - }, - "roles": { - "type": "array", - "items": [ - { - "type": "string" - } - ] - } - }, - "required": [ - "title", - "description", - "href", - "type", - "roles" - ] - } - } - } - } -} \ No newline at end of file diff --git a/public/FormSchemas/renderSchema.json b/public/FormSchemas/renderSchema.json deleted file mode 100644 index 0ac55ff..0000000 --- a/public/FormSchemas/renderSchema.json +++ /dev/null @@ -1,285 +0,0 @@ -{ - "$schema": "http://json-schema.org/draft-07/schema#", - "$id": "https://stac-extensions.github.io/render/v2.0.0/schema.json#", - "title": "Rendering Extension", - "oneOf": [ - { - "$comment": "This is the schema for STAC Items.", - "allOf": [ - { - "$ref": "#/definitions/stac_extensions" - }, - { - "type": "object", - "required": [ - "type", - "properties", - "assets" - ], - "properties": { - "type": { - "const": "Feature" - }, - "properties": { - "type": "object", - "required": [ - "renders" - ], - "properties": { - "renders": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/fields" - } - } - } - } - } - }, - { - "if": { - "properties": { - "stac_extensions": { - "contains": { - "type": "string", - "pattern": "https:\/\/stac-extensions\\.github\\.io\/web-map-links\/.*" - } - } - } - }, - "then": { - "properties": { - "links": { - "type": "array", - "contains": { - "type": "object", - "required": [ - "rel", - "render" - ], - "properties": { - "render": { - "type": "string" - } - } - } - } - } - } - } - ] - }, - { - "$comment": "This is the schema for STAC Collections.", - "type": "object", - "allOf": [ - { - "required": [ - "type", - "renders" - ], - "properties": { - "type": { - "const": "Collection" - } - } - }, - { - "$ref": "#/definitions/stac_extensions" - } - ], - "anyOf": [ - { - "$comment": "This validates the fields in Collection Assets, but does not require them.", - "anyOf": [ - { - "type": "object", - "required": [ - "assets" - ] - }, - { - "type": "object", - "required": [ - "item_assets" - ] - } - ], - "properties": { - "renders": { - "type": "object", - "not": { - "additionalProperties": { - "not": { - "allOf": [ - { - "$ref": "#/definitions/require_any_field" - }, - { - "$ref": "#/definitions/fields" - } - ] - } - } - } - } - } - } - ] - } - ], - "definitions": { - "stac_extensions": { - "type": "object", - "required": [ - "stac_extensions" - ], - "properties": { - "stac_extensions": { - "type": "array", - "minItems": 1, - "maxItems": 1, - "items": { - "const": "https://stac-extensions.github.io/render/v2.0.0/schema.json" - } - } - } - }, - "require_any_field": { - "$comment": "Please list all fields here so that we can force the existence of one of them in other parts of the schemas.", - "anyOf": [ - { - "type": "object", - "required": [ - "assets" - ] - }, - { - "type": "object", - "required": [ - "title" - ] - }, - { - "type": "object", - "required": [ - "rescale" - ] - }, - { - "type": "object", - "required": [ - "nodata" - ] - }, - { - "type": "object", - "required": [ - "colormap_name" - ] - }, - { - "type": "object", - "required": [ - "colormap" - ] - }, - { - "type": "object", - "required": [ - "color_formula" - ] - }, - { - "type": "object", - "required": [ - "resampling" - ] - }, - { - "type": "object", - "required": [ - "expression" - ] - }, - { - "type": "object", - "required": [ - "minmax_zoom" - ] - }, - { - "type": "object", - "required": [ - "bidx" - ] - } - ] - }, - "fields": { - "$comment": "Add your new fields here. Don't require them here, do that above in the corresponding schema.", - "type": "object", - "required": [ - "assets" - ], - "properties": { - "assets": { - "type": "array", - "items": { - "type": "string" - } - }, - "title": { - "type": "string" - }, - "rescale": { - "type": "array", - "items": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "nodata": { - "type": [ - "number", - "string" - ] - }, - "colormap_name": { - "type": "string" - }, - "colormap": { - "type": "object" - }, - "color_formula": { - "type": "string" - }, - "resampling": { - "type": "string" - }, - "expression": { - "type": [ - "string", - "object", - "array" - ] - }, - "minmax_zoom": { - "type": "array", - "items": { - "type": "number" - } - }, - "bidx": { - "type": "array", - "items": { - "type": "number" - } - } - }, - "additionalProperties": true - } - } -} \ No newline at end of file