- Notifications
You must be signed in to change notification settings - Fork10.5k
[release/8.0] Add explicit conversion for value-type returning handlers with filters#57966
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
BrennanConroy commentedSep 24, 2024
Does RDG handle this? I did a quick search and wasn't able to find any tests that cover it for RDG |
captainsafia commentedSep 25, 2024
RDG doesn't have this problem because the compiler will do the conversion implicitly when a value type is passed into thethis method. As for tests, I don't believe we have test coverage for this scenario in RDG but I can add one (or move the tests that we have here to the shared infrastructure). |
captainsafia commentedOct 1, 2024
Approved via email. |
Uh oh!
There was an error while loading.Please reload this page.
Description
Merged in 10.0:#57428
Addresses#52128.
This PR fixes a bug with the handling of value type-returning handlers that are used in conjunction with endpoint filters. Such as:
This currently throws:
Because the return type requires an explicit conversion before being wrapped as a
ValueTask<object>to confirm with theEndpointFilterDelegate's signature.Customer Impact
Without this bug fix, user applications that contain minimal API endpoints that return value types and use endpoint filters will fail to launch. Viable workarounds exist (for example, wrapping the value return in a
Results.Ok), but they are difficult for the typical user to discover.Regression?
Risk
Scope of impact is limited to minimal APIs + endpoint filters + compile-time code generation.
Verification
Packaging changes reviewed?