HAKOM.ErrorHandling.Http.Net.Api.Extensions Namespace
Contains extension methods for integrating HAKOM error handling into ASP.NET Core applications.
Remarks
Section titled “Remarks”This namespace provides the primary configuration entry points for setting up RFC 7807 error handling in a web application. The extension methods target common ASP.NET Core types such as Microsoft.AspNetCore.Builder.WebApplicationBuilder, Microsoft.AspNetCore.Mvc.MvcOptions, and IContainer.
Typical setup order:// 1. Register serialization and error-handling DI servicesbuilder.Services.AddHakomServices(container =>{ container .UseResultJsonSerialization() .UseHttpFailureFactory();});
// 2. Add problem-details middleware (after AddControllers)builder.AddHakomErrorHandling();
// 3. Configure MVC output formatters and filtersbuilder.Services.AddControllers(options =>{ options.AddProblemDetailsFormatter(); options.AddSuccessResultFormatter(); options.ReturnBadRequestOnExtraneousQueryParameters();});See also SchemaRepositoryExtensions for OpenAPI/Swagger helpers used when building custom operation filters.
| Classes | |
|---|---|
| ContainerExtensions | Registers types used for handling errors in an HTTP/Webservice context. |
| MvcOptionsExtensions | Extension methods for adding error-handling features to an application using Microsofts MVC framework. |
| ProblemDetailsServiceExtensions | Provides additional methods for writing RFC7807 problem details to HTTP responses. |
| SchemaRepositoryExtensions | Provides extension methods to make OpenApi schemas used for error handling available to custom operation filters, etc. |
| WebApplicationBuilderExtensions | Adds services for error handling to a web application. |
Was this page helpful?Thanks for your feedback!