Open buti1021 opened 1 year ago
Related to #126.
We need a better story for managing strings and internationalization.
I think there shouldn't be more than one error, per ProblemDetails instance. Is there a common approach in dotnet, to returning a list of multiple ProblemDetails?
Because then the developer could work with a list of ProblemDetails, and concatenate the errors himself, and also translate it by himself how he sees fit using only the actual error message, he defined returned from the ProblemDetails.Detail field.
I am facing the internationalization error myself right now working with this package.
The error messages get translated into the details property of the problem details object. By the RFC standard this property is a string. Currently a list of errormessages can be passed to the NotFound and Error Method, which then get concatenated. e.g.,: https://github.com/ardalis/Result/blob/1c8a9f53b8995e82af0b1650b5c83ec15060289a/src/Ardalis.Result.AspNetCore/ResultStatusMap.cs#L117-L120 This breaks internationalization, as the string at the start is english and already happens if only a single string is passed. I think the best approach would be to allow only strings and make the developer responsible for concatenation. What do you think? @ardalis @KyleMcMaster