Skip to content
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

Merge master into openapi #1645

Merged
merged 8 commits into from
Nov 27, 2024
Merged

Merge master into openapi #1645

merged 8 commits into from
Nov 27, 2024

Conversation

bkoelman
Copy link
Member

Merges the master branch into openapi, which provides fixes for resource inheritance.

…ct derived type must be available in `QueryLayer.Selection`, which wasn't the case.

Parsing of include chains is changed to include relationships on all concrete derived types.
For example, given an inclusion chain of "wheels" at `/vehicles`, the parser now returns `Car.Wheels` and `Truck.Wheels`. This used to be `Vehicle.Wheels`. There's no point in adding abstract types, because they can't be instantiated in selectors.

`QueryLayerComposer` was fixed to generate selectors for the left-type of these relationships, instead of for the `QueryLayer` resource type (so `Car.Wheels` and `Truck.Wheels` instead of `Vehicle.Wheels`).

`SelectClauseBuilder` was missing a cast to the derived type when descending into relationship selectors, which is fixed now.

Being unable to include relationships of sibling types after a POST/PATCH resource request at a base endpoint was because a `QueryLayer` for fetch-after-post was built against the accurized resource type, and then sent to the original (non-accurized) repository. For example, `POST /vehicles?include=TruckRelationship,CarRelationship` only works if the query executes against the non-accurized table (so `Vehicle` instead of `Car`, because `Car` doesn't contain `TruckRelationship`). The fix is to discard the accurized resource type and use the original `TResource`.

Other improvements:
- During the process of building expression trees, consistency checks have been added to prevent downstream crashes that are difficult to diagnose.
- `SelectClauseBuilder` internally passed along a `LambdaScope` that overruled the one present in context, so care had to be taken to use the right one. To eliminate this pitfall, now a new context is forked which contains the appropriate `LambdaScope`, so the overruling parameter is no longer needed.

Fixes #1639, fixes #1640.
- Turn off scanning for vulnerable dependencies in downstream packages
- Turn off warning when targeting NETSTANDARD 1.x
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 90.90909% with 9 lines in your changes missing coverage. Please review.

Project coverage is 90.46%. Comparing base (e5a7084) to head (575f579).
Report is 9 commits behind head on openapi.

Files with missing lines Patch % Lines
...ies/QueryableBuilding/QueryClauseBuilderContext.cs 50.00% 2 Missing and 1 partial ⚠️
...Core/Queries/QueryableBuilding/QueryableBuilder.cs 40.00% 2 Missing and 1 partial ⚠️
...e/Queries/QueryableBuilding/SelectClauseBuilder.cs 90.32% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           openapi    #1645      +/-   ##
===========================================
- Coverage    90.50%   90.46%   -0.05%     
===========================================
  Files          459      459              
  Lines        13915    13938      +23     
  Branches      2156     2166      +10     
===========================================
+ Hits         12594    12609      +15     
- Misses         897      903       +6     
- Partials       424      426       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@bkoelman bkoelman marked this pull request as ready for review November 27, 2024 00:38
@bkoelman bkoelman merged commit 9010f16 into openapi Nov 27, 2024
16 checks passed
@bkoelman bkoelman deleted the merge-master-into-openapi branch November 27, 2024 00:42
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.

1 participant