Skip to content

Add ProblemDetails helpers to minimal actions #34169

@pranavkm

Description

@pranavkm
  • Move ProblemDetails from MVC lower in to the ASP.NET Core stack (type forward)
  • Add ProblemDetails as a helper method.

ValidationProblemDetails is tricky because it references ModelStateDictionary, so we'll leave it be in MVC for the immediate future.

========

API Review:

  • Type forward Microsoft.AspNetCore.Mvc.ProblemDetails to the Microsoft.AspNetCore.Http.Extensions assembly.
+ namespace Microsoft.AspNetCore.Http.Extensions
+ {
+     public class HttpValidationProblemDetails : ProblemDetails
+     {
+         public HttpValidationProblemDetails();
+         public HttpValidationProblemDetails(IDictionary<string, string[]> errors);
+         public IDictionary<string, string[]> Errors { get; }
+     }
+ }

namespace Microsoft.AspNetCore.Mvc
{
-   public class ValidationProblemDetails : ProblemDetails
+   public class ValidationProblemDetails : HttpValidationProblemDetails
    {
    }
}

Metadata

Metadata

Assignees

Labels

api-approvedAPI was approved in API review, it can be implementedarea-minimalIncludes minimal APIs, endpoint filters, parameter binding, request delegate generator etcfeature-minimal-actionsController-like actions for endpoint routing

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions