Skip to content

errorMessages should be passed as string #124

@buti1021

Description

@buti1021

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.,:

var details = new StringBuilder("Next error(s) occured:");
foreach (var error in result.Errors) details.Append("* ").Append(error).AppendLine();

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions