diff --git a/extensions/linz/schema.json b/extensions/linz/schema.json index 7130e3dc..c877ff67 100644 --- a/extensions/linz/schema.json +++ b/extensions/linz/schema.json @@ -1040,7 +1040,6 @@ }, "summaries": { "type": "object", - "required": ["created", "updated"], "properties": { "created": { "type": "object", diff --git a/extensions/linz/tests/linz_collection.test.js b/extensions/linz/tests/linz_collection.test.js index 9dea747c..1fa22a0d 100644 --- a/extensions/linz/tests/linz_collection.test.js +++ b/extensions/linz/tests/linz_collection.test.js @@ -85,7 +85,7 @@ o.spec('LINZ collection', () => { ).equals(true)(JSON.stringify(validate.errors)); }); - o("Summaries with no 'created' property should fail validation", async () => { + o("Summaries with no 'created' property should not fail validation", async () => { // given const example = JSON.parse(await fs.readFile(examplePath)); delete example['summaries']['created']; @@ -94,12 +94,19 @@ o.spec('LINZ collection', () => { let valid = validate(example); // then - o(valid).equals(false); - o( - validate.errors.some( - (error) => error.instancePath === '/summaries' && error.message === "must have required property 'created'", - ), - ).equals(true)(JSON.stringify(validate.errors)); + o(valid).equals(true); + }); + + o("Summaries with no 'updated' property should not fail validation", async () => { + // given + const example = JSON.parse(await fs.readFile(examplePath)); + delete example['summaries']['updated']; + + // when + let valid = validate(example); + + // then + o(valid).equals(true); }); o("Example with no 'linz:geospatial_type' property should fail validation", async () => {