Skip to content

Filters: allow has() with a condition #986

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
May 17, 2021
Merged

Conversation

bart-degreed
Copy link
Contributor

@bart-degreed bart-degreed commented May 2, 2021

Adds support for an optional condition in the has function within filter query strings.
Also added EBNF grammar for filters to documentation and narrowed some types in the filter parse tree.

Closes #985.

@bart-degreed
Copy link
Contributor Author

/CC @wayne-o because you asked about this in the Gitter chat some time ago.

@bart-degreed bart-degreed requested a review from maurei May 2, 2021 21:10
@bart-degreed bart-degreed marked this pull request as draft May 2, 2021 21:12
@bart-degreed
Copy link
Contributor Author

@maurei Reverted to Draft, because my code contains a TODO that I still need to investigate.

@codecov
Copy link

codecov bot commented May 2, 2021

Codecov Report

Merging #986 (f13af09) into master (d033166) will increase coverage by 0.03%.
The diff coverage is 88.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #986      +/-   ##
==========================================
+ Coverage   91.26%   91.30%   +0.03%     
==========================================
  Files         281      281              
  Lines        7429     7463      +34     
==========================================
+ Hits         6780     6814      +34     
  Misses        649      649              
Impacted Files Coverage Δ
...ore/Queries/Expressions/QueryExpressionRewriter.cs 0.91% <0.00%> (ø)
...ueries/Expressions/CollectionNotEmptyExpression.cs 70.83% <85.71%> (+20.83%) ⬆️
...otNetCore/Queries/Expressions/LogicalExpression.cs 55.55% <100.00%> (ø)
...ApiDotNetCore/Queries/Expressions/NotExpression.cs 50.00% <100.00%> (ø)
...otNetCore/Queries/Internal/Parsing/FilterParser.cs 98.56% <100.00%> (+0.13%) ⬆️
...ies/Internal/QueryableBuilding/QueryableBuilder.cs 100.00% <100.00%> (ø)
...s/Internal/QueryableBuilding/WhereClauseBuilder.cs 94.23% <100.00%> (+0.75%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d033166...f13af09. Read the comment docs.

@bart-degreed bart-degreed force-pushed the has-with-condition branch from 97ca1cc to 05dc242 Compare May 3, 2021 07:35
@bart-degreed bart-degreed changed the title Has with condition Filters: allow has() with a condition May 3, 2021
Bart Koelman added 4 commits May 3, 2021 09:51
…e has() function.

Example: GET /blogs?filter=has(posts,not(equals(url,null)))
…parsers already constrained the input, so API users should not observe any effects of this change.
@bart-degreed bart-degreed force-pushed the has-with-condition branch from 05dc242 to ad2625d Compare May 3, 2021 07:51
@bart-degreed bart-degreed marked this pull request as ready for review May 3, 2021 08:13
@bart-degreed bart-degreed merged commit b387363 into master May 17, 2021
@bart-degreed bart-degreed deleted the has-with-condition branch May 17, 2021 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Filters: allow condition on has() function
2 participants