Hlibz.MinimalApi.Endpoints 1.0.0

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

Hlibz.MinimalApi.Endpoints icon

Hlibz.MinimalApi.Endpoints

NuGet CI

One class per minimal API endpoint, found and mapped for you, with its OpenAPI responses documented from what the endpoint is.

dotnet add package Hlibz.MinimalApi.Endpoints
internal sealed class OrdersEndpointGroup : IEndpointGroup
{
    public string Prefix => "api/orders";

    public void Configure(RouteGroupBuilder group) => group.WithTags("Orders");
}

internal sealed class GetOrderEndpoint : IEndpoint<OrdersEndpointGroup>
{
    public RouteHandlerBuilder Map(IEndpointRouteBuilder group) =>
        group.MapGet("{id:int}", Handle)
            .RequireAuthorization("Member")
            .ProducesErrors(StatusCodes.Status404NotFound);

    private static Results<Ok<OrderDto>, NotFound> Handle(int id, IOrderService orders) =>
        orders.Find(id) is { } order ? TypedResults.Ok(order) : TypedResults.NotFound();
}

app.MapEndpoints(typeof(Program).Assembly);

Map is a plain minimal API chain. The endpoint is mapped into its group, named GetOrder, and documents 200 as OrderDto (from the handler's return type) plus 404, and 401/403 because it ends up requiring authorization. 429 is documented whenever it ends up rate limited, 413 for uploads (.AcceptsUpload(maxBytes)), and file downloads via .ProducesFile(contentType). The endpoint class's XML <summary> becomes the operation description, read by the generator at compile time (no documentation file needed). Errors use ProblemDetails unless you set your own (options.UseErrorResponse<TError>()); app-wide rules go in group and endpoint conventions (options.ConfigureGroups<IAdminEndpointGroup>(...)).

Endpoints are listed and checked at compile time by a source generator and analyzer that ship inside the package: no assembly scan at startup, and an endpoint that can't be mapped (no group, no parameterless constructor, a Map that doesn't map exactly one route, ...) is a build error rather than a startup failure.

Full documentation and samples: github.com/hlib-zinchenko/Hlibz.MinimalApi.Endpoints.

Product Compatible and additional computed target framework versions.
.NET 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.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net11.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Hlibz.MinimalApi.Endpoints:

Package Downloads
Hlibz.MinimalApi.Endpoints.FluentValidation

Automatic FluentValidation for Hlibz.MinimalApi.Endpoints: options.AddFluentValidation() attaches a validation filter to every endpoint whose handler takes a parameter with an IValidator<T> registered, and documents its 400. Nothing to opt into per endpoint. The failure is a validation problem by default, or whatever result your API returns (e.g. Hlibz.Results' result.ToErrorResult().ToHttpResult()). Validators resolve per request, so any lifetime works. Works with FluentValidation 11.0.0 and later.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 53 11/18/2026
1.0.0-preview.7 79 11/14/2026
1.0.0-preview.6 63 11/13/2026
1.0.0-preview.5 68 11/13/2026
1.0.0-preview.4 63 11/13/2026
1.0.0-preview.3 63 11/13/2026
1.0.0-preview.2 60 11/12/2026
1.0.0-preview.1 66 11/11/2026