From cbb5a3fc721f2b42619403278cc66849f3e3058c Mon Sep 17 00:00:00 2001 From: Victor Engmark Date: Wed, 17 Nov 2021 15:29:19 +1300 Subject: [PATCH] feat: Fix strict ajv warnings See . --- extensions/aerial-photo/schema.json | 1 + extensions/film/schema.json | 1 + extensions/historical-imagery/schema.json | 21 +++++++++++++++++++++ extensions/linz/schema.json | 12 ++++++++++++ extensions/template/schema.json | 12 +++++++++--- 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/extensions/aerial-photo/schema.json b/extensions/aerial-photo/schema.json index d2c78f29..37f71429 100644 --- a/extensions/aerial-photo/schema.json +++ b/extensions/aerial-photo/schema.json @@ -14,6 +14,7 @@ "properties": { "allOf": [ { + "type": "object", "required": ["aerial-photo:run", "aerial-photo:sequence_number"] }, { diff --git a/extensions/film/schema.json b/extensions/film/schema.json index 97978a63..65bba8ea 100644 --- a/extensions/film/schema.json +++ b/extensions/film/schema.json @@ -14,6 +14,7 @@ "properties": { "allOf": [ { + "type": "object", "required": ["film:id", "film:negative_sequence"] }, { diff --git a/extensions/historical-imagery/schema.json b/extensions/historical-imagery/schema.json index 1a4654b7..de3177c0 100644 --- a/extensions/historical-imagery/schema.json +++ b/extensions/historical-imagery/schema.json @@ -23,6 +23,7 @@ "type": "object", "$comment": "Require fields here for Item Asset Properties.", "additionalProperties": { + "type": "object", "required": ["eo:bands"] } } @@ -63,41 +64,49 @@ "type": "array", "allOf": [ { + "type": "array", "contains": { "const": "https://stac.linz.govt.nz/_STAC_VERSION_/historical-imagery/schema.json" } }, { + "type": "array", "contains": { "const": "https://stac-extensions.github.io/eo/v1.0.0/schema.json" } }, { + "type": "array", "contains": { "const": "https://stac-extensions.github.io/projection/v1.0.0/schema.json" } }, { + "type": "array", "contains": { "const": "https://stac-extensions.github.io/file/v2.0.0/schema.json" } }, { + "type": "array", "contains": { "const": "https://stac.linz.govt.nz/_STAC_VERSION_/aerial-photo/schema.json" } }, { + "type": "array", "contains": { "const": "https://stac.linz.govt.nz/_STAC_VERSION_/camera/schema.json" } }, { + "type": "array", "contains": { "const": "https://stac.linz.govt.nz/_STAC_VERSION_/film/schema.json" } }, { + "type": "array", "contains": { "const": "https://stac.linz.govt.nz/_STAC_VERSION_/scanning/schema.json" } @@ -125,9 +134,12 @@ "providers": { "allOf": [ { + "type": "array", "contains": { + "type": "object", "properties": { "roles": { + "type": "array", "contains": { "const": "licensor" } @@ -136,9 +148,12 @@ } }, { + "type": "array", "contains": { + "type": "object", "properties": { "roles": { + "type": "array", "contains": { "const": "producer" } @@ -147,9 +162,12 @@ } }, { + "type": "array", "contains": { + "type": "object", "properties": { "roles": { + "type": "array", "contains": { "const": "processor" } @@ -158,9 +176,12 @@ } }, { + "type": "array", "contains": { + "type": "object", "properties": { "roles": { + "type": "array", "contains": { "const": "host" } diff --git a/extensions/linz/schema.json b/extensions/linz/schema.json index 9ee37791..9fa0c6d9 100644 --- a/extensions/linz/schema.json +++ b/extensions/linz/schema.json @@ -120,9 +120,12 @@ "linz:providers": { "allOf": [ { + "type": "array", "contains": { + "type": "object", "properties": { "roles": { + "type": "array", "contains": { "const": "manager" } @@ -131,9 +134,12 @@ } }, { + "type": "array", "contains": { + "type": "object", "properties": { "roles": { + "type": "array", "contains": { "const": "custodian" } @@ -178,9 +184,12 @@ "providers": { "allOf": [ { + "type": "array", "contains": { + "type": "object", "properties": { "roles": { + "type": "array", "contains": { "const": "licensor" } @@ -189,9 +198,12 @@ } }, { + "type": "array", "contains": { + "type": "object", "properties": { "roles": { + "type": "array", "contains": { "const": "producer" } diff --git a/extensions/template/schema.json b/extensions/template/schema.json index d6672872..ca6459d2 100644 --- a/extensions/template/schema.json +++ b/extensions/template/schema.json @@ -20,6 +20,7 @@ "properties": { "allOf": [ { + "type": "object", "$comment": "Require fields here for Item Properties.", "required": ["template:new_field"] }, @@ -44,6 +45,7 @@ "type": "object", "allOf": [ { + "type": "object", "required": ["type"], "properties": { "type": { @@ -60,6 +62,7 @@ "$comment": "This is the schema for the top-level fields in a Collection. Remove this if this extension does not define top-level fields for Collections.", "allOf": [ { + "type": "object", "$comment": "Require fields here for Collections (top-level).", "required": ["template:new_field"] }, @@ -69,6 +72,7 @@ ] }, { + "type": "object", "$comment": "This validates the fields in Collection Assets, but does not require them.", "required": ["assets"], "properties": { @@ -92,6 +96,7 @@ } }, { + "type": "object", "$comment": "This is the schema for the fields in Item Asset Definitions. It doesn't require any fields.", "required": ["item_assets"], "properties": { @@ -115,6 +120,7 @@ } }, { + "type": "object", "$comment": "This is the schema for the fields in Summaries. By default, only checks the existence of the properties, but not the schema of the summaries.", "required": ["summaries"], "properties": { @@ -142,9 +148,9 @@ "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": [ - { "required": ["template:new_field"] }, - { "required": ["template:xyz"] }, - { "required": ["template:another_one"] } + { "type": "object", "required": ["template:new_field"] }, + { "type": "object", "required": ["template:xyz"] }, + { "type": "object", "required": ["template:another_one"] } ] }, "fields": {