MinimalApi.Responses
1.0.0
dotnet add package MinimalApi.Responses --version 1.0.0
NuGet\Install-Package MinimalApi.Responses -Version 1.0.0
<PackageReference Include="MinimalApi.Responses" Version="1.0.0" />
<PackageVersion Include="MinimalApi.Responses" Version="1.0.0" />
<PackageReference Include="MinimalApi.Responses" />
paket add MinimalApi.Responses --version 1.0.0
#r "nuget: MinimalApi.Responses, 1.0.0"
#:package MinimalApi.Responses@1.0.0
#addin nuget:?package=MinimalApi.Responses&version=1.0.0
#tool nuget:?package=MinimalApi.Responses&version=1.0.0
๐ฆ MinimalApi.Responses
A lightweight, elegant, and type-safe API response wrapper for .NET Minimal APIs
โจ Why MinimalApi.Responses?
Stop writing boilerplate. Start delivering consistent APIs.
Every API needs a standard response format. Yet most projects end up
reinventing the wheel---scattering inconsistent response logic across
endpoints.
MinimalApi.Responses provides a clean, fluent interface that
enforces consistent response shapes across your entire API with zero
configuration.
// ๐ซ Without this library - Inconsistent, verbose
return TypedResults.Json(new { Success = true, Data = user, Errors = Array.Empty<string>() });
// โ
With this library - Clean, consistent, self-documenting
return endpoint.ApiSuccess(user);
๐ฏ Key Features
Feature Description
๐ฆ Standardized Response ApiResponse<T>{=html} with consistent
Wrapper success/error shape
๐งน Zero Boilerplate Clean extension methods eliminate repetitive code
๐ Sync & Async Support Both synchronous and asynchronous helpers
โ ๏ธ RFC 7807 Compliant Native Problem Details support for HTTP APIs
๐ฏ Type-Safe Full generic support with compile-time checking
๐ Self-Documenting Rich IntelliSense and XML documentation
๐ Multi-Target Supports .NET 8.0, 9.0, and 10.0
๐ฆ Installation
Package Manager Console
Install-Package MinimalApi.Responses
.NET CLI
dotnet add package MinimalApi.Responses
PackageReference
<PackageReference Include="MinimalApi.Responses" Version="1.0.0" />
๐ Quick Start
using MinimalApi.Responses;
var app = WebApplication.CreateBuilder(args).Build();
app.MapGet("/users/{id}", (int id, object endpoint) =>
{
var user = GetUserById(id);
return user is not null
? endpoint.ApiSuccess(user)
: endpoint.ApiFailure("User not found");
});
app.Run();
๐ Response Formats
โ Success Response (200 OK)
{
"success": true,
"data": {
"id": 1,
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com"
},
"errors": []
}
โ Failure Response
{
"success": false,
"data": null,
"errors": [
"User not found"
]
}
โ ๏ธ Problem Details (RFC 7807)
{
"type": "https://tools.ietf.org/html/rfc9110#section-15.5.1",
"title": "Validation Error",
"status": 400,
"detail": "The 'email' field must be a valid email address",
"instance": "/api/users"
}
๐ License
MIT License
Free for personal and commercial use.
Built with โค๏ธ for the .NET community by Muammar Siddiqui
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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 is compatible. 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 is compatible. 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. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
-
net9.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 158 | 2/12/2026 |