ardalis / ardalis/Result

errorMessages should be passed as string

Open
#124 4 comments 0 reactions 0 assignees View on GitHub
enhancement good first issue hacktoberfest help wanted
Dominant language
C#
Stars
1k
Forks
127
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

Research direction

Start with src/Ardalis.Result.AspNetCore/ResultStatusMap.cs at the linked lines and review how NotFound and Error construct the problem details object. Check the RFC requirement for the details property and existing tests or call sites before deciding the compatible API behavior; done means error details remain valid strings without implicit concatenation.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
api
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.