Skip to content

Results.Problem does not support configuring Extensions #36848

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

Closed
captainsafia opened this issue Sep 22, 2021 · 3 comments
Closed

Results.Problem does not support configuring Extensions #36848

captainsafia opened this issue Sep 22, 2021 · 3 comments
Assignees
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc bug This issue describes a behavior which is not expected - a bug. feature-minimal-actions Controller-like actions for endpoint routing old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Milestone

Comments

@captainsafia
Copy link
Member

The ProblemDetails class defines an Extensions property that allows the user to configure the ProblemDetails object with additional metadata.

The Results.Problem extension method does not accept an extensions parameter for setting this leaving the user with no options to return a ProblemDetails with a custom Extensions.

Note: this change will require an API change.

public static IResult Problem(
string? detail = null,
string? instance = null,
int? statusCode = null,
string? title = null,
string? type = null)
{
var problemDetails = new ProblemDetails
{
Detail = detail,
Instance = instance,
Status = statusCode,
Title = title,
Type = type
};
return new ObjectResult(problemDetails)
{
ContentType = "application/problem+json",
};
}

@captainsafia captainsafia added bug This issue describes a behavior which is not expected - a bug. old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels labels Sep 22, 2021
@captainsafia captainsafia added this to the 6.0-rc2 milestone Sep 22, 2021
@captainsafia captainsafia self-assigned this Sep 22, 2021
@davidfowl
Copy link
Member

@captainsafia this is fixed right?

@captainsafia
Copy link
Member Author

Yep -- the fix was merged to RC2 today. Keeping this open to validate in published bits.

@captainsafia
Copy link
Member Author

Validated in 6.0.100-rc.2.21477.4.

@ghost ghost locked as resolved and limited conversation to collaborators Nov 3, 2021
@amcasey amcasey added the area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc label Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-minimal Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc bug This issue describes a behavior which is not expected - a bug. feature-minimal-actions Controller-like actions for endpoint routing old-area-web-frameworks-do-not-use *DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels
Projects
None yet
Development

No branches or pull requests

4 participants