Customize ProblemDetails results with Minimal API
- Dominant language
- C#
- Stars
- 1k
- Forks
- 127
- PR merge metrics
- No merged PRs in 30d
Description
Is there currently any way to override the way that ProblemDetails are constructed in [ResultExtensions](https://github.com/ardalis/Result/blob/main/src/Ardalis.Result/ResultExtensions.cs) when using Minimal API? When using full blown Controllers, this is something very easy to do by manipulating `AddResultConvention`, but I don't see anything similar for Minimal API, as `ToMinimalApiResult` hard codes the format of the ProblemDetails, which doesn't entirely fit our needs.
If this is not possible, are there any plans to implement this?
I could write my own extension method, but it seems a bit of a waste to throw out all the logic that's already present in the Ardalis.Result package, so I wanted to check first.
Contributor guide
Research direction
Start with src/Ardalis.Result/ResultExtensions.cs and inspect ToMinimalApiResult to understand how ProblemDetails are currently constructed. Define what customization should preserve from the existing mapping and how a Minimal API caller would supply it; done means the hard-coded format can be overridden without discarding the package's existing result-to-response logic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100