From 8181a1330f7abe66596fa5c341b92cc690f3a57e Mon Sep 17 00:00:00 2001 From: Malikah Montgomery Date: Tue, 23 May 2023 14:05:54 -0400 Subject: [PATCH] Update based on PR comments - leave target as required while still in schema Signed-off-by: Malikah Montgomery --- packages/catalog-model/src/schema/shared/common.schema.json | 2 +- .../src/validation/entitySchemaValidator.test.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/catalog-model/src/schema/shared/common.schema.json b/packages/catalog-model/src/schema/shared/common.schema.json index 77eb4a2612..7468bd9d70 100644 --- a/packages/catalog-model/src/schema/shared/common.schema.json +++ b/packages/catalog-model/src/schema/shared/common.schema.json @@ -32,7 +32,7 @@ "$id": "#relation", "type": "object", "description": "A directed relation from one entity to another.", - "required": ["type", "targetRef"], + "required": ["type", "target", "targetRef"], "additionalProperties": false, "properties": { "type": { diff --git a/packages/catalog-model/src/validation/entitySchemaValidator.test.ts b/packages/catalog-model/src/validation/entitySchemaValidator.test.ts index 7ae6a1fa05..bc31c5d800 100644 --- a/packages/catalog-model/src/validation/entitySchemaValidator.test.ts +++ b/packages/catalog-model/src/validation/entitySchemaValidator.test.ts @@ -365,9 +365,9 @@ describe('entitySchemaValidator', () => { expect(() => validator(entity)).toThrow(/relations/); }); - it('does not reject missing relations.target', () => { + it('does reject missing relations.target', () => { delete entity.relations[0].target; - expect(() => validator(entity)).not.toThrow(/relations/); + expect(() => validator(entity)).toThrow(/relations/); }); it('does reject missing relations.targetRef', () => {