From 744cf03a950b681a61f1f4cf6a7bb55bc52836c9 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Wed, 11 Sep 2024 15:10:56 -0400 Subject: [PATCH] Don't proceed with `type_union_implicit` if no validation vocabulary (#234) Signed-off-by: Juan Cruz Viotti --- src/linter/implicit/type_union_implicit.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/linter/implicit/type_union_implicit.h b/src/linter/implicit/type_union_implicit.h index 85e98f8..d9c16d4 100644 --- a/src/linter/implicit/type_union_implicit.h +++ b/src/linter/implicit/type_union_implicit.h @@ -21,8 +21,13 @@ class TypeUnionImplicit final : public sourcemeta::alterschema::Rule { "http://json-schema.org/draft-03/schema#", "http://json-schema.org/draft-02/hyper-schema#", "http://json-schema.org/draft-01/hyper-schema#", - "http://json-schema.org/draft-00/hyper-schema#"}) && - schema.defines("type")) { + "http://json-schema.org/draft-00/hyper-schema#"})) { + if (schema.defines("type")) { + return false; + } + + // Don't apply if we don't have the necessary vocabularies + } else { return false; }