From 7a4ad6e9cd5499a23a81d0c7f2651dcf2f3541f6 Mon Sep 17 00:00:00 2001 From: vitaligi <54726763+vitaligi@users.noreply.github.com> Date: Wed, 18 Mar 2026 19:24:27 +0200 Subject: [PATCH 1/8] feat: common dem schema --- schemas/dem/common/v1.schema.json | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 schemas/dem/common/v1.schema.json diff --git a/schemas/dem/common/v1.schema.json b/schemas/dem/common/v1.schema.json new file mode 100644 index 00000000..1f518d68 --- /dev/null +++ b/schemas/dem/common/v1.schema.json @@ -0,0 +1,31 @@ +{ + "$id": "https://mapcolonies.com/dem/common/v1", + "type": "object", + "title": "commonDEMSchemaV1", + "description": "Common DEM schema", + "allOf": [ + { + "$ref": "#/definitions/storage" + } + ], + "definitions": { + "storage": { + "type": "object", + "description": "DEM storage", + "unevaluatedProperties": false, + "required": ["sourceDir"], + "properties": { + "sourceDir": { + "$ref": "#/definitions/sourceDir" + } + }, + "x-env-value": "STORAGE" + }, + "sourceDir": { + "type": "string", + "description": "DEM data source directory", + "minLength": 1, + "x-env-value": "STORAGE_SOURCE_DIR" + } + } +} From 704c3a1743b520f58578a26105ed6c7dbe2c6f27 Mon Sep 17 00:00:00 2001 From: vitaligi <54726763+vitaligi@users.noreply.github.com> Date: Wed, 18 Mar 2026 19:24:46 +0200 Subject: [PATCH 2/8] feat: dem-gateway schema --- schemas/dem/demGateway/v1.schema.json | 164 ++++++++++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 schemas/dem/demGateway/v1.schema.json diff --git a/schemas/dem/demGateway/v1.schema.json b/schemas/dem/demGateway/v1.schema.json new file mode 100644 index 00000000..a60df1ce --- /dev/null +++ b/schemas/dem/demGateway/v1.schema.json @@ -0,0 +1,164 @@ +{ + "$id": "https://mapcolonies.com/dem/demGateway/v1", + "type": "object", + "title": "demGatewaySchemaV1", + "description": "DEM gateway schema", + "allOf": [ + { + "$ref": "https://mapcolonies.com/common/boilerplate/v3" + }, + { + "$ref": "https://mapcolonies.com/infra/jobnik/sdk/partial/v1" + }, + { + "$ref": "https://mapcolonies.com/dem/common/v1" + }, + { + "$ref": "#/definitions/storage" + }, + { + "$ref": "#/definitions/application" + } + ], + "definitions": { + "application": { + "type": "object", + "description": "Application configuration", + "unevaluatedProperties": false, + "required": [ + "blockSize", + "compression", + "defaultGeographicSrsId", + "defaultProjectedSrsId", + "resolutionDegree", + "resolutionMeter", + "supportedFormatsMap", + "supportedSrsIds" + ], + "properties": { + "blockSize": { + "type": "integer", + "description": "DEM internal block size", + "default": 256, + "minimum": 16, + "multipleOf": 16, + "x-env-value": "BLOCK_SIZE" + }, + "compression": { + "type": "string", + "description": "DEM compression", + "default": "LZW", + "minLength": 1, + "x-env-value": "COMPRESSION" + }, + "defaultGeographicSrsId": { + "type": "integer", + "description": "Default geographic SRS id used for internal projections", + "default": 4326, + "minimum": 0, + "x-env-value": "DEFAULT_GEOGRAPHIC_SRS_ID" + }, + "defaultProjectedSrsId": { + "type": "integer", + "description": "Default projected SRS id used for internal projections", + "default": 3395, + "minimum": 0, + "x-env-value": "DEFAULT_PROJECTED_SRS_ID" + }, + "resolutionDegree": { + "type": "object", + "description": "DEM resolution in degrees", + "required": ["min", "max"], + "unevaluatedProperties": false, + "properties": { + "min": { + "type": "number", + "default": 0.00000009060870470168063430786, + "exclusiveMinimum": 0, + "x-env-value": "RESOLUTION_DEGREE_MIN" + }, + "max": { + "type": "number", + "default": 0.08982, + "exclusiveMinimum": 0, + "x-env-value": "RESOLUTION_DEGREE_MAX" + } + } + }, + "resolutionMeter": { + "type": "object", + "description": "DEM resolution in meters", + "required": ["min", "max"], + "unevaluatedProperties": false, + "properties": { + "min": { + "type": "number", + "default": 0.01, + "exclusiveMinimum": 0, + "x-env-value": "RESOLUTION_METER_MIN" + }, + "max": { + "type": "number", + "default": 10000, + "exclusiveMinimum": 0, + "x-env-value": "RESOLUTION_METER_MAX" + } + } + }, + "supportedFormatsMap": { + "type": "object", + "description": "Supported formats map. Maps common format identifier to internal identifier supported for usage", + "examples": [ + { + "geotiff": "gtiff" + } + ], + "unevaluatedProperties": false, + "patternProperties": { + "^[a-z][a-z0-9_]*$": { + "type": "string", + "minLength": 1 + } + }, + "minProperties": 1, + "x-env-value": "SUPPORTED_FORMATS_MAP" + }, + "supportedSrsIds": { + "type": "array", + "description": "Supported projection codes as registered by EPSG", + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 0 + }, + "minItems": 1, + "x-env-value": "SUPPORTED_SRS_IDS" + } + } + }, + "storage": { + "type": "object", + "description": "DEM storage configuration for serving storage", + "unevaluatedProperties": false, + "required": ["displayNameDir", "validFileExtensions"], + "properties": { + "displayNameDir": { + "type": "string", + "minLength": 1, + "default": "\\layerSources", + "x-env-value": "STORAGE_DISPLAY_NAME_DIR" + }, + "validFileExtensions": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "minItems": 1, + "default": ["tif"], + "x-env-value": "STORAGE_VALID_FILE_EXTENSIONS" + } + } + } + } +} From e07e340f17b3a3ff22d2c224d14b0d24eeeffdc4 Mon Sep 17 00:00:00 2001 From: vitaligi <54726763+vitaligi@users.noreply.github.com> Date: Wed, 18 Mar 2026 23:54:46 +0200 Subject: [PATCH 3/8] refactor: modify dem-gateway shemas hierarchy --- schemas/dem/demGateway/v1.schema.json | 34 ++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/schemas/dem/demGateway/v1.schema.json b/schemas/dem/demGateway/v1.schema.json index a60df1ce..eb0ed4d6 100644 --- a/schemas/dem/demGateway/v1.schema.json +++ b/schemas/dem/demGateway/v1.schema.json @@ -8,16 +8,38 @@ "$ref": "https://mapcolonies.com/common/boilerplate/v3" }, { - "$ref": "https://mapcolonies.com/infra/jobnik/sdk/partial/v1" - }, - { - "$ref": "https://mapcolonies.com/dem/common/v1" + "type": "object", + "required": ["jobnik"], + "properties": { + "jobnik": { + "$ref": "https://mapcolonies.com/infra/jobnik/sdk/partial/v1" + } + } }, { - "$ref": "#/definitions/storage" + "type": "object", + "required": ["storage"], + "properties": { + "storage": { + "allOf": [ + { + "$ref": "https://mapcolonies.com/dem/common/v1" + }, + { + "$ref": "#/definitions/storage" + } + ] + } + } }, { - "$ref": "#/definitions/application" + "type": "object", + "required": ["application"], + "properties": { + "application": { + "$ref": "#/definitions/application" + } + } } ], "definitions": { From 55f3e9a4978ac7794895bfce4c94facac47cbf4f Mon Sep 17 00:00:00 2001 From: vitaligi <54726763+vitaligi@users.noreply.github.com> Date: Thu, 19 Mar 2026 00:51:27 +0200 Subject: [PATCH 4/8] refactor: organize files and extend common storage schema --- .../dem/common/{ => storage}/v1.schema.json | 6 ++---- schemas/dem/demGateway/v1.schema.json | 20 +++++++++---------- 2 files changed, 12 insertions(+), 14 deletions(-) rename schemas/dem/common/{ => storage}/v1.schema.json (81%) diff --git a/schemas/dem/common/v1.schema.json b/schemas/dem/common/storage/v1.schema.json similarity index 81% rename from schemas/dem/common/v1.schema.json rename to schemas/dem/common/storage/v1.schema.json index 1f518d68..e8083ad6 100644 --- a/schemas/dem/common/v1.schema.json +++ b/schemas/dem/common/storage/v1.schema.json @@ -1,5 +1,5 @@ { - "$id": "https://mapcolonies.com/dem/common/v1", + "$id": "https://mapcolonies.com/dem/common/storage/v1", "type": "object", "title": "commonDEMSchemaV1", "description": "Common DEM schema", @@ -12,14 +12,12 @@ "storage": { "type": "object", "description": "DEM storage", - "unevaluatedProperties": false, "required": ["sourceDir"], "properties": { "sourceDir": { "$ref": "#/definitions/sourceDir" } - }, - "x-env-value": "STORAGE" + } }, "sourceDir": { "type": "string", diff --git a/schemas/dem/demGateway/v1.schema.json b/schemas/dem/demGateway/v1.schema.json index eb0ed4d6..4dd727a0 100644 --- a/schemas/dem/demGateway/v1.schema.json +++ b/schemas/dem/demGateway/v1.schema.json @@ -12,7 +12,9 @@ "required": ["jobnik"], "properties": { "jobnik": { - "$ref": "https://mapcolonies.com/infra/jobnik/sdk/partial/v1" + "type": "object", + "$ref": "https://mapcolonies.com/infra/jobnik/sdk/partial/v1", + "unevaluatedProperties": false } } }, @@ -21,14 +23,7 @@ "required": ["storage"], "properties": { "storage": { - "allOf": [ - { - "$ref": "https://mapcolonies.com/dem/common/v1" - }, - { - "$ref": "#/definitions/storage" - } - ] + "$ref": "#/definitions/storage" } } }, @@ -160,9 +155,14 @@ }, "storage": { "type": "object", + "allOf": [ + { + "$ref": "https://mapcolonies.com/dem/common/storage/v1" + } + ], "description": "DEM storage configuration for serving storage", - "unevaluatedProperties": false, "required": ["displayNameDir", "validFileExtensions"], + "unevaluatedProperties": false, "properties": { "displayNameDir": { "type": "string", From 78b93d501c6c442b0685dbae637d1421d35b96ba Mon Sep 17 00:00:00 2001 From: vitaligi <54726763+vitaligi@users.noreply.github.com> Date: Thu, 19 Mar 2026 17:39:53 +0200 Subject: [PATCH 5/8] refactor: include the full jobnik schema in dem-gateway --- schemas/dem/demGateway/v1.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/dem/demGateway/v1.schema.json b/schemas/dem/demGateway/v1.schema.json index 4dd727a0..7a44c7a9 100644 --- a/schemas/dem/demGateway/v1.schema.json +++ b/schemas/dem/demGateway/v1.schema.json @@ -13,7 +13,7 @@ "properties": { "jobnik": { "type": "object", - "$ref": "https://mapcolonies.com/infra/jobnik/sdk/partial/v1", + "$ref": "https://mapcolonies.com/infra/jobnik/sdk/full/v1", "unevaluatedProperties": false } } From b5dbbedd3650a749db85635f1f85299f03971750 Mon Sep 17 00:00:00 2001 From: vitaligi <54726763+vitaligi@users.noreply.github.com> Date: Thu, 19 Mar 2026 18:45:26 +0200 Subject: [PATCH 6/8] refactor: group validation related schemas under scope --- schemas/dem/demGateway/v1.schema.json | 149 +++++++++++++------------- 1 file changed, 74 insertions(+), 75 deletions(-) diff --git a/schemas/dem/demGateway/v1.schema.json b/schemas/dem/demGateway/v1.schema.json index 7a44c7a9..1891d721 100644 --- a/schemas/dem/demGateway/v1.schema.json +++ b/schemas/dem/demGateway/v1.schema.json @@ -42,32 +42,8 @@ "type": "object", "description": "Application configuration", "unevaluatedProperties": false, - "required": [ - "blockSize", - "compression", - "defaultGeographicSrsId", - "defaultProjectedSrsId", - "resolutionDegree", - "resolutionMeter", - "supportedFormatsMap", - "supportedSrsIds" - ], + "required": ["defaultGeographicSrsId", "defaultProjectedSrsId", "supportedFormatsMap", "validation"], "properties": { - "blockSize": { - "type": "integer", - "description": "DEM internal block size", - "default": 256, - "minimum": 16, - "multipleOf": 16, - "x-env-value": "BLOCK_SIZE" - }, - "compression": { - "type": "string", - "description": "DEM compression", - "default": "LZW", - "minLength": 1, - "x-env-value": "COMPRESSION" - }, "defaultGeographicSrsId": { "type": "integer", "description": "Default geographic SRS id used for internal projections", @@ -82,46 +58,6 @@ "minimum": 0, "x-env-value": "DEFAULT_PROJECTED_SRS_ID" }, - "resolutionDegree": { - "type": "object", - "description": "DEM resolution in degrees", - "required": ["min", "max"], - "unevaluatedProperties": false, - "properties": { - "min": { - "type": "number", - "default": 0.00000009060870470168063430786, - "exclusiveMinimum": 0, - "x-env-value": "RESOLUTION_DEGREE_MIN" - }, - "max": { - "type": "number", - "default": 0.08982, - "exclusiveMinimum": 0, - "x-env-value": "RESOLUTION_DEGREE_MAX" - } - } - }, - "resolutionMeter": { - "type": "object", - "description": "DEM resolution in meters", - "required": ["min", "max"], - "unevaluatedProperties": false, - "properties": { - "min": { - "type": "number", - "default": 0.01, - "exclusiveMinimum": 0, - "x-env-value": "RESOLUTION_METER_MIN" - }, - "max": { - "type": "number", - "default": 10000, - "exclusiveMinimum": 0, - "x-env-value": "RESOLUTION_METER_MAX" - } - } - }, "supportedFormatsMap": { "type": "object", "description": "Supported formats map. Maps common format identifier to internal identifier supported for usage", @@ -140,16 +76,79 @@ "minProperties": 1, "x-env-value": "SUPPORTED_FORMATS_MAP" }, - "supportedSrsIds": { - "type": "array", - "description": "Supported projection codes as registered by EPSG", - "uniqueItems": true, - "items": { - "type": "integer", - "minimum": 0 - }, - "minItems": 1, - "x-env-value": "SUPPORTED_SRS_IDS" + "validation": { + "type": "object", + "description": "Validation configurations", + "unevaluatedProperties": false, + "required": ["blockSize", "compression", "resolutionDegree", "resolutionMeter", "supportedSrsIds"], + "properties": { + "blockSize": { + "type": "integer", + "description": "DEM internal block size", + "default": 256, + "minimum": 16, + "multipleOf": 16, + "x-env-value": "BLOCK_SIZE" + }, + "compression": { + "type": "string", + "description": "DEM compression", + "default": "LZW", + "minLength": 1, + "x-env-value": "COMPRESSION" + }, + "resolutionDegree": { + "type": "object", + "description": "DEM resolution in degrees", + "required": ["min", "max"], + "unevaluatedProperties": false, + "properties": { + "min": { + "type": "number", + "default": 0.00000009060870470168063430786, + "exclusiveMinimum": 0, + "x-env-value": "RESOLUTION_DEGREE_MIN" + }, + "max": { + "type": "number", + "default": 0.08982, + "exclusiveMinimum": 0, + "x-env-value": "RESOLUTION_DEGREE_MAX" + } + } + }, + "resolutionMeter": { + "type": "object", + "description": "DEM resolution in meters", + "required": ["min", "max"], + "unevaluatedProperties": false, + "properties": { + "min": { + "type": "number", + "default": 0.01, + "exclusiveMinimum": 0, + "x-env-value": "RESOLUTION_METER_MIN" + }, + "max": { + "type": "number", + "default": 10000, + "exclusiveMinimum": 0, + "x-env-value": "RESOLUTION_METER_MAX" + } + } + }, + "supportedSrsIds": { + "type": "array", + "description": "Supported projection codes as registered by EPSG", + "uniqueItems": true, + "items": { + "type": "integer", + "minimum": 0 + }, + "minItems": 1, + "x-env-value": "SUPPORTED_SRS_IDS" + } + } } } }, From 087f19ed3b79c563e82bea215a98506b78387008 Mon Sep 17 00:00:00 2001 From: vitaligi <54726763+vitaligi@users.noreply.github.com> Date: Thu, 19 Mar 2026 22:24:35 +0200 Subject: [PATCH 7/8] refactor: pr comments move common schemas --- schemas/common/storage/v1.schema.json | 20 ++++++++++ schemas/common/storageExplorer/v1.schema.json | 30 +++++++++++++++ schemas/dem/common/storage/v1.schema.json | 29 --------------- schemas/dem/demGateway/v1.schema.json | 37 +++---------------- 4 files changed, 56 insertions(+), 60 deletions(-) create mode 100644 schemas/common/storage/v1.schema.json create mode 100644 schemas/common/storageExplorer/v1.schema.json delete mode 100644 schemas/dem/common/storage/v1.schema.json diff --git a/schemas/common/storage/v1.schema.json b/schemas/common/storage/v1.schema.json new file mode 100644 index 00000000..4ecb2fc0 --- /dev/null +++ b/schemas/common/storage/v1.schema.json @@ -0,0 +1,20 @@ +{ + "$id": "https://mapcolonies.com/common/storage/v1", + "type": "object", + "title": "commonStorageSchemaV1", + "description": "Common storage schema", + "required": ["sourceDir"], + "properties": { + "sourceDir": { + "$ref": "#/definitions/sourceDir" + } + }, + "definitions": { + "sourceDir": { + "type": "string", + "description": "Data source directory", + "minLength": 1, + "x-env-value": "STORAGE_SOURCE_DIR" + } + } +} diff --git a/schemas/common/storageExplorer/v1.schema.json b/schemas/common/storageExplorer/v1.schema.json new file mode 100644 index 00000000..e52abd24 --- /dev/null +++ b/schemas/common/storageExplorer/v1.schema.json @@ -0,0 +1,30 @@ +{ + "$id": "https://mapcolonies.com/common/storageExplorer/v1", + "type": "object", + "title": "commonStorageExplorerSchemaV1", + "description": "Storage explorer middleware configuration schema", + "unevaluatedProperties": false, + "required": ["displayNameDir", "validFileExtensions"], + "allOf": [ + { + "$ref": "https://mapcolonies.com/common/storage/v1" + } + ], + "properties": { + "displayNameDir": { + "type": "string", + "minLength": 1, + "default": "\\layerSources", + "x-env-value": "STORAGE_DISPLAY_NAME_DIR" + }, + "validFileExtensions": { + "type": "array", + "items": { + "type": "string", + "minLength": 1 + }, + "minItems": 1, + "x-env-value": "STORAGE_VALID_FILE_EXTENSIONS" + } + } +} diff --git a/schemas/dem/common/storage/v1.schema.json b/schemas/dem/common/storage/v1.schema.json deleted file mode 100644 index e8083ad6..00000000 --- a/schemas/dem/common/storage/v1.schema.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "$id": "https://mapcolonies.com/dem/common/storage/v1", - "type": "object", - "title": "commonDEMSchemaV1", - "description": "Common DEM schema", - "allOf": [ - { - "$ref": "#/definitions/storage" - } - ], - "definitions": { - "storage": { - "type": "object", - "description": "DEM storage", - "required": ["sourceDir"], - "properties": { - "sourceDir": { - "$ref": "#/definitions/sourceDir" - } - } - }, - "sourceDir": { - "type": "string", - "description": "DEM data source directory", - "minLength": 1, - "x-env-value": "STORAGE_SOURCE_DIR" - } - } -} diff --git a/schemas/dem/demGateway/v1.schema.json b/schemas/dem/demGateway/v1.schema.json index 1891d721..975d9dff 100644 --- a/schemas/dem/demGateway/v1.schema.json +++ b/schemas/dem/demGateway/v1.schema.json @@ -20,10 +20,10 @@ }, { "type": "object", - "required": ["storage"], + "required": ["storageExplorer"], "properties": { - "storage": { - "$ref": "#/definitions/storage" + "storageExplorer": { + "$ref": "#/definitions/storageExplorer" } } }, @@ -152,34 +152,9 @@ } } }, - "storage": { - "type": "object", - "allOf": [ - { - "$ref": "https://mapcolonies.com/dem/common/storage/v1" - } - ], - "description": "DEM storage configuration for serving storage", - "required": ["displayNameDir", "validFileExtensions"], - "unevaluatedProperties": false, - "properties": { - "displayNameDir": { - "type": "string", - "minLength": 1, - "default": "\\layerSources", - "x-env-value": "STORAGE_DISPLAY_NAME_DIR" - }, - "validFileExtensions": { - "type": "array", - "items": { - "type": "string", - "minLength": 1 - }, - "minItems": 1, - "default": ["tif"], - "x-env-value": "STORAGE_VALID_FILE_EXTENSIONS" - } - } + "storageExplorer": { + "description": "DEM storage explorer middleware configuration schema", + "$ref": "https://mapcolonies.com/common/storageExplorer/v1" } } } From 5fddcd74d81bd15a9681fc2c0f698c224940764b Mon Sep 17 00:00:00 2001 From: vitaligi <54726763+vitaligi@users.noreply.github.com> Date: Mon, 13 Apr 2026 11:26:05 +0300 Subject: [PATCH 8/8] refactor: remove default srs ids --- schemas/dem/demGateway/v1.schema.json | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/schemas/dem/demGateway/v1.schema.json b/schemas/dem/demGateway/v1.schema.json index 975d9dff..77e75373 100644 --- a/schemas/dem/demGateway/v1.schema.json +++ b/schemas/dem/demGateway/v1.schema.json @@ -42,22 +42,8 @@ "type": "object", "description": "Application configuration", "unevaluatedProperties": false, - "required": ["defaultGeographicSrsId", "defaultProjectedSrsId", "supportedFormatsMap", "validation"], + "required": ["supportedFormatsMap", "validation"], "properties": { - "defaultGeographicSrsId": { - "type": "integer", - "description": "Default geographic SRS id used for internal projections", - "default": 4326, - "minimum": 0, - "x-env-value": "DEFAULT_GEOGRAPHIC_SRS_ID" - }, - "defaultProjectedSrsId": { - "type": "integer", - "description": "Default projected SRS id used for internal projections", - "default": 3395, - "minimum": 0, - "x-env-value": "DEFAULT_PROJECTED_SRS_ID" - }, "supportedFormatsMap": { "type": "object", "description": "Supported formats map. Maps common format identifier to internal identifier supported for usage",