Allow derived inclusion chains in filter/sort/page query strings#1756
Merged
Allow derived inclusion chains in filter/sort/page query strings#1756
Conversation
9c5b3b3 to
c7ca5b4
Compare
Member
Author
|
Holding off on the merge until the coverage diff works again. Tracked at codecov/codecov-action#1852. |
4763035 to
fb82615
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1756 +/- ##
==========================================
- Coverage 92.06% 92.06% -0.01%
==========================================
Files 475 475
Lines 14699 14722 +23
Branches 2322 2331 +9
==========================================
+ Hits 13533 13554 +21
- Misses 765 766 +1
- Partials 401 402 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds support for using derived inclusion chains in filter/sort/page query string parameters.
For example:
The following query now applies the specified filter only on cars:
Before, the request would fail with HTTP 400:
Minor breaking API changes:
QueryStringParameterScopeExpression.Scope: Type changed fromResourceFieldChainExpression?toIncludeExpression?.PaginationElementQueryStringValueExpression.Scope: Type changed fromResourceFieldChainExpression?toIncludeExpression?.IQueryStringParameterScopeParser.Parse: removedpatternandoptionsparameters.IncludeParser.ParseInclude/QueryStringParameterScopeParser.ParseQueryStringParameterScope: removedsourceparameter, which is now available as a property on the base class.The breaking changes are required to support multiple derived relationships in an inclusion chain. Parsing scopes in filter/sort/page now works similarly to how the value of the
includequery string parameter is parsed.For example, assume that type
Truckalso has aWheelsto-many relationship. Thewheelsscope infilter[wheels]is now parsed into two inclusion chains: one forCarand one forTruck, so that the filter can be applied to both. To visualize the change, callToFullString()on the expression.Fixes #1642.
QUALITY CHECKLIST