From 1b3e71c6c90db3d4b091ed20153e210ae3ac3f33 Mon Sep 17 00:00:00 2001 From: Paul DeVito Date: Thu, 1 Oct 2026 17:20:33 +0300 Subject: [PATCH] fix(operators)!: name HasType in the has error message The has operator (^$) on a property that is not a collection threw the message of the does-not-have operator: "DoesNotHaveType is only supported for collections". Throw "HasType is only supported for collections" instead. BREAKING CHANGE: the message of the QueryKitParsingException for has (^$) on a property that is not a collection changes from "DoesNotHaveType is only supported for collections" to "HasType is only supported for collections". Code that matches the old message text must match the new text. --- QueryKit.UnitTests/FilterParserTests.cs | 4 ++-- QueryKit/Operators/ComparisonOperator.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/QueryKit.UnitTests/FilterParserTests.cs b/QueryKit.UnitTests/FilterParserTests.cs index 200e8e0..3121e05 100644 --- a/QueryKit.UnitTests/FilterParserTests.cs +++ b/QueryKit.UnitTests/FilterParserTests.cs @@ -817,12 +817,12 @@ public void primitive_collection_does_not_have_case_insensitive() } [Fact] - public void has_type_on_non_collection_property_throws_the_v1_14_2_message() + public void has_type_throws_correct_message_on_non_collection_property() { var input = """Title ^$ "winner" """; var act = () => FilterParser.ParseFilter(input); act.Should().Throw() - .WithMessage("DoesNotHaveType is only supported for collections"); + .WithMessage("HasType is only supported for collections"); } [Fact] diff --git a/QueryKit/Operators/ComparisonOperator.cs b/QueryKit/Operators/ComparisonOperator.cs index 18834f8..789ef3f 100644 --- a/QueryKit/Operators/ComparisonOperator.cs +++ b/QueryKit/Operators/ComparisonOperator.cs @@ -766,7 +766,7 @@ public override Expression GetExpression(Expression left, Expression right, T return GetCollectionExpression(left, right, Expression.Equal, UsesAll); } - throw new QueryKitParsingException("DoesNotHaveType is only supported for collections"); + throw new QueryKitParsingException("HasType is only supported for collections"); } }