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
<PackageReference Include="Hlibz.MinimalApi.Endpoints" Version="1.0.0" />
<PackageVersion Include="Hlibz.MinimalApi.Endpoints" Version="1.0.0" />
<PackageReference Include="Hlibz.MinimalApi.Endpoints" />
paket add Hlibz.MinimalApi.Endpoints --version 1.0.0
#r "nuget: Hlibz.MinimalApi.Endpoints, 1.0.0"
#:package Hlibz.MinimalApi.Endpoints@1.0.0
#addin nuget:?package=Hlibz.MinimalApi.Endpoints&version=1.0.0
#tool nuget:?package=Hlibz.MinimalApi.Endpoints&version=1.0.0
![]()
Hlibz.MinimalApi.Endpoints
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.
Related packages
- Hlibz.MinimalApi.Endpoints.FluentValidation:
request validation with FluentValidation, with its
400documented. - Hlibz.Results.AspNetCore: one error body for every failure, documented as the endpoints' error schema.
- Hlibz.OpenApi.AspNetCore: OpenAPI transformers for rules, strongly typed IDs and security.
Full documentation and samples: github.com/hlib-zinchenko/Hlibz.MinimalApi.Endpoints.
| Product | Versions 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. |
-
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 |