Skip to content

Results.Problem does not support configuring Extensions #36848

Closed
@captainsafia

Description

@captainsafia

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",
};
}

Metadata

Metadata

Assignees

Labels

area-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcbugThis issue describes a behavior which is not expected - a bug.feature-minimal-actionsController-like actions for endpoint routingold-area-web-frameworks-do-not-use*DEPRECATED* This label is deprecated in favor of the area-mvc and area-minimal labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions