Interface IApiErrorWriter
Writes the errors the runtime itself answers with, before a handler runs: a request-binding
failure (malformed JSON, limit=abc, a missing required parameter) or a failed request
validation. The service registers one implementation, so every API keeps its own error body;
a typical implementation answers the body only when the matched operation declares
the status (Declares(int)) and the bare status otherwise.
public interface IApiErrorWriter
Methods
InvalidRequest(IReadOnlyList<ResultProblem>, int, ApiOperation?)
Answers an invalid request with status (400 unless the framework says
otherwise), explaining it with problems.
IResult InvalidRequest(IReadOnlyList<ResultProblem> problems, int status, ApiOperation? operation)
Parameters
problemsIReadOnlyList<ResultProblem>What is wrong; never empty.
statusintThe status to answer with.
operationApiOperationThe matched operation, or null when the request matched none.