-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Improve Results.Problem and Results.ValidationProblem APIs #36856
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a few smoke tests that the extensions are there and the new overloads work?
06bc3bd
to
dc173b4
Compare
Co-authored-by: Stephen Halter <[email protected]>
"Hi captainsafia. Please make sure you've updated the PR description to use the Shiproom Template. Also, make sure this PR is not marked as a draft and is ready-to-merge. To learn more about how to prepare a servicing PR click here. |
Closing since we decided to target |
Re-opening since this was Servicing approved for RC2. See #36884 (comment). |
@dotnet/aspnet-build Can I get help merging? |
* Update WiX to signed build (#36865) - #12078 * Always download blazor-hotreload.js from app root (#36897) The middleware that we inject always listens to the root of the app. While this might not play very nicely if the app is running off a virtual path, listening to the root is what we do with the aspnet-browser-refresh.js script and we've had no issue reports with it thus far. Fixes #35555 * Improve Results.Problem and Results.ValidationProblem APIs (#36856) * [release/6.0-rc2] Update sdk to 6.0.100-rc.2.21470.55 (#36783) * Update sdk to 6.0.100-rc.2.21470.55 Co-authored-by: Will Godbe <[email protected]> Co-authored-by: Doug Bunting <[email protected]> Co-authored-by: Pranav K <[email protected]> Co-authored-by: Safia Abdalla <[email protected]> Co-authored-by: Stephen Halter <[email protected]> Co-authored-by: Will Godbe <[email protected]> Co-authored-by: Brennan <[email protected]>
Description
In .NET 6, we introduced new extension methods as shorthands for creating Results types from endpoint. However, due to an error, we missed adding a parameter to the
Results.Problem
andResults.ValidationProblem
to align with theExtensions
property available in those types.As a result of this, customers are not able to return
ProblemDetails
orHttpValidationProblemDetails
with a configuredExtensions
type from their APIs.Customer Impact
Without this fix, customers are not able to return to return
ProblemDetails
objectsThere are no desirable workarounds for this issue since the
Results.Problem
andResults.ValidationProblem
provide a public abstraction over a lot of currently internal functionality, like setting sensible defaults for the title and type of ProblemDetails.Regression?
Risk
Low risk because:
Results
extension methods API.Verification
Packaging changes reviewed?
Background and Motivation
The
Results.Problem
andResults.Validation
extension methods do not provide a way for users to customize theExtensions
property on the resultingProblemDetails
payload.To support these scenarios, we are adding the
extensions
parameter to the existing methods and adding new overloads that takes aProblemDetails
orHttpValidationProblemDetails
object to provide further customizability for users.Proposed API
Usage Examples
Fixes #36848