Knight.Response.Abstractions.Http
1.0.0
See the version list below for details.
dotnet add package Knight.Response.Abstractions.Http --version 1.0.0
NuGet\Install-Package Knight.Response.Abstractions.Http -Version 1.0.0
<PackageReference Include="Knight.Response.Abstractions.Http" Version="1.0.0" />
<PackageVersion Include="Knight.Response.Abstractions.Http" Version="1.0.0" />
<PackageReference Include="Knight.Response.Abstractions.Http" />
paket add Knight.Response.Abstractions.Http --version 1.0.0
#r "nuget: Knight.Response.Abstractions.Http, 1.0.0"
#:package Knight.Response.Abstractions.Http@1.0.0
#addin nuget:?package=Knight.Response.Abstractions.Http&version=1.0.0
#tool nuget:?package=Knight.Response.Abstractions.Http&version=1.0.0
Knight.Response.Abstractions.Http
Cross‑framework abstractions for HTTP result handling in the Knight.Response family.
This package collects the shared contracts and options that both
Knight.Response.AspNetCore
(for modern ASP.NET Core / minimal APIs), andKnight.Response.AspNetCore.Mvc
(for legacy ASP.NET Core MVC 2.x / .NET Framework scenarios)
use to keep behavior consistent.
Target frameworks: .NET Standard 2.0 (works with .NET Framework 4.7.1+ and .NET Core/.NET 6+).
What’s inside
KnightResponseBaseOptions<TProblem, TValidation>
Base options class that centralizes:UseProblemDetails
UseValidationProblemDetails
IncludeFullResultPayload
IncludeExceptionDetails
StatusCodeResolver
delegates- Optional builders/hooks for shaping problem responses
The generic parameters let each integration plug in the framework’s own
ProblemDetails
/ValidationProblemDetails
types without duplication.Validation error mapping
IValidationErrorMapper
— abstraction for converting domainMessage
s into aDictionary<string,string[]>
suitable for validation problems.DefaultValidationErrorMapper
— pragmatic mapper that:- reads an explicit
field
from message metadata when available, and - falls back to parsing messages in the form
"field: message"
.
- reads an explicit
Install
dotnet add package Knight.Response.Abstractions.Http
You typically won’t reference this directly in application code; it’s a transitive dependency of the ASP.NET integration packages. It’s useful if you’re building your own integration and want to align with Knight.Response conventions.
Quick example (custom mapper)
using Knight.Response.Abstractions.Http.Mappers;
public sealed class MyValidationMapper : IValidationErrorMapper
{
public IDictionary<string, string[]> Map(IReadOnlyList<Message> messages)
=> new Dictionary<string, string[]> { ["name"] = new[] { "is required" } };
}
Register this type in the DI container of your chosen integration package
(e.g., Knight.Response.AspNetCore
or Knight.Response.AspNetCore.Mvc
).
Related packages
Knight.Response
— immutableResult
/Result<T>
core library.Knight.Response.AspNetCore
— modern ASP.NET Core + minimal APIs integration.Knight.Response.AspNetCore.Mvc
— ASP.NET Core MVC 2.x / .NET Framework–friendly integration.
License
Licensed under the MIT License. See LICENSE
in the repository root.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Knight.Response (>= 1.0.2)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Knight.Response.Abstractions.Http:
Package | Downloads |
---|---|
Knight.Response.AspNetCore
ASP.NET Core helpers for Knight.Response: map Result/Result<T> to IResult/ActionResult with consistent HTTP semantics. |
GitHub repositories
This package is not used by any popular GitHub repositories.
- Initial release of Knight.Response.Abstractions.Http
- Provides shared abstractions for Knight.Response HTTP integrations
- Includes:
• KnightResponseBaseOptions (common options for HTTP response behavior)
• IValidationErrorMapper and DefaultValidationErrorMapper
- Designed for reuse by Knight.Response.AspNetCore and Knight.Response.AspNetCore.Mvc
- Targets .NET Standard 2.0 for maximum compatibility