MinimalApi.Responses 1.0.0

dotnet add package MinimalApi.Responses --version 1.0.0
                    
NuGet\Install-Package MinimalApi.Responses -Version 1.0.0
                    
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="MinimalApi.Responses" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MinimalApi.Responses" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="MinimalApi.Responses" />
                    
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 MinimalApi.Responses --version 1.0.0
                    
#r "nuget: MinimalApi.Responses, 1.0.0"
                    
#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 MinimalApi.Responses@1.0.0
                    
#: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=MinimalApi.Responses&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=MinimalApi.Responses&version=1.0.0
                    
Install as a Cake Tool

๐Ÿ“ฆ MinimalApi.Responses

A lightweight, elegant, and type-safe API response wrapper for .NET Minimal APIs

NuGet NuGet
Downloads License:
MIT .NET


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