Skip to content

Commit 65107d5

Browse files
Merge pull request #38 from intility/remove-or-max-count
refactor: 🔨 remove the OR max count
2 parents 0cdf9a5 + 5a3aa87 commit 65107d5

2 files changed

Lines changed: 0 additions & 42 deletions

File tree

JsonApiToolkit.Tests/Extensions/IncludeFilterParserTests.cs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -236,39 +236,6 @@ public void SeparateIncludeFilters_WithFilterOnNonIncludedRelationship_ReturnsAs
236236
Assert.Empty(includeFilters);
237237
}
238238

239-
[Fact]
240-
public void SeparateIncludeFilters_WithTooManyOrConditions_ThrowsException()
241-
{
242-
// Arrange
243-
var filters = new FilterGroup
244-
{
245-
LogicalOperator = LogicalOperator.Or,
246-
Filters = new List<FilterParameter>(),
247-
};
248-
249-
// Add 11 OR conditions (exceeds limit of 10)
250-
for (int i = 0; i < 11; i++)
251-
{
252-
filters.Filters.Add(
253-
new FilterParameter
254-
{
255-
Field = "comments.status",
256-
Operator = FilterOperator.Eq,
257-
Value = $"value{i}",
258-
}
259-
);
260-
}
261-
262-
var includePaths = new List<string> { "comments" };
263-
264-
// Act & Assert
265-
var exception = Assert.Throws<JsonApiBadRequestException>(
266-
() => IncludeFilterParser.SeparateIncludeFilters(filters, includePaths)
267-
);
268-
269-
Assert.Contains("Too many OR conditions", exception.Message);
270-
}
271-
272239
[Fact]
273240
public void SeparateIncludeFilters_WithTooDeepNesting_ThrowsException()
274241
{

JsonApiToolkit/Extensions/Querying/Filtering/IncludeFilterParser.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ public static class IncludeFilterParser
1010
{
1111
private const int MaxIncludeFilterDepth = 3;
1212
private const int MaxIncludeFilters = 20;
13-
private const int MaxOrConditions = 10;
1413

1514
/// <summary>
1615
/// Separates main filters from include filters.
@@ -57,14 +56,6 @@ Dictionary<string, FilterGroup> filtersByRelationship
5756
{
5857
var newGroup = new FilterGroup { LogicalOperator = group.LogicalOperator };
5958

60-
// Check OR conditions count
61-
if (group.LogicalOperator == LogicalOperator.Or && group.Filters.Count > MaxOrConditions)
62-
{
63-
throw new JsonApiBadRequestException(
64-
$"Too many OR conditions in filter group. Maximum allowed: {MaxOrConditions}"
65-
);
66-
}
67-
6859
// Track filters for each relationship in this group
6960
var localIncludeFilters = new Dictionary<string, FilterGroup>(StringComparer.OrdinalIgnoreCase);
7061

0 commit comments

Comments
 (0)