From dcea401ec2cd8b569d85d2fa13a04a60cbf9df0e Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Mon, 14 Sep 2026 17:33:13 +0200 Subject: [PATCH] 11b: fail on combinators an attribute kind cannot read --- src/adf-schema.test.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/adf-schema.test.ts b/src/adf-schema.test.ts index 742f24b..de8eb89 100644 --- a/src/adf-schema.test.ts +++ b/src/adf-schema.test.ts @@ -161,6 +161,8 @@ function propertyKinds(property: SchemaObject, where: string): AttributeKind[] { if (type === 'string') return ['string'] if (type === 'array' || type === 'object') return ['json'] if (type !== undefined) return assert.fail(`${where}: the schema types it ${JSON.stringify(type)}, which reads as no attribute kind`) + const combinator = ['$ref', 'allOf', 'anyOf'].find((keyword) => property[keyword] !== undefined) + if (combinator !== undefined) return assert.fail(`${where}: the schema holds the keyword ${combinator}, which the gate reads as no attribute kind`) const values = property['enum'] return Array.isArray(values) ? values.map(valueKind) : ['json'] }