Update based on PR comments - leave target as required while still in schema

Signed-off-by: Malikah Montgomery <malikah.montgomery@thoughtworks.com>
This commit is contained in:
Malikah Montgomery
2023-05-23 14:05:54 -04:00
parent 7911556148
commit 8181a1330f
2 changed files with 3 additions and 3 deletions
@@ -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": {
@@ -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', () => {