Knight.Response.Abstractions.Http 1.0.2

dotnet add package Knight.Response.Abstractions.Http --version 1.0.2
                    
NuGet\Install-Package Knight.Response.Abstractions.Http -Version 1.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Knight.Response.Abstractions.Http" Version="1.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Knight.Response.Abstractions.Http" Version="1.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Knight.Response.Abstractions.Http" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Knight.Response.Abstractions.Http --version 1.0.2
                    
#r "nuget: Knight.Response.Abstractions.Http, 1.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Knight.Response.Abstractions.Http@1.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Knight.Response.Abstractions.Http&version=1.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Knight.Response.Abstractions.Http&version=1.0.2
                    
Install as a Cake Tool

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), and
  • Knight.Response.AspNetCore.Mvc (for legacy ASP.NET Core MVC 2.x / .NET Framework scenarios)

use to keep behavior consistent.

NuGet Version ci Mutation score

Target frameworks: .NET Standard 2.0 (works with .NET Framework 4.7.1+ and .NET Core/.NET 6+).


What’s inside

  • KnightResponseBaseOptions<TH, 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 HttpContext type (TH), ProblemDetails type (TProblem), and ValidationProblemDetails type (TValidation) without duplication.

  • Validation error mapping

    • IValidationErrorMapper — abstraction for converting domain Messages into a Dictionary<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".

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).


  • Knight.Response — immutable Result / 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

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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.

Version Downloads Last Updated
1.0.2 146 9/1/2025
1.0.1 232 8/28/2025
1.0.0 166 8/28/2025

Changed:
           - Updated dependency on **Knight.Response** to v1.1.0.
           - Guarantees compatibility with new validation support (`Results.Validation(...)`).
           - No functional changes introduced in this release.