DynamicEndpoints 0.4.0
dotnet add package DynamicEndpoints --version 0.4.0
NuGet\Install-Package DynamicEndpoints -Version 0.4.0
<PackageReference Include="DynamicEndpoints" Version="0.4.0" />
<PackageVersion Include="DynamicEndpoints" Version="0.4.0" />
<PackageReference Include="DynamicEndpoints" />
paket add DynamicEndpoints --version 0.4.0
#r "nuget: DynamicEndpoints, 0.4.0"
#:package DynamicEndpoints@0.4.0
#addin nuget:?package=DynamicEndpoints&version=0.4.0
#tool nuget:?package=DynamicEndpoints&version=0.4.0
DynamicEndpoints
Runtime-defined HTTP endpoints for ASP.NET Core. Click it in a panel โ it's live. Restart the app โ it's still there.
Admins configure endpoints (route, parameters, validation, business rules). Developers write the building blocks
(processors and validators). Endpoints are real ASP.NET Core RouteEndpoints: they are created and removed at runtime,
validated on save, persisted, and documented as OpenAPI 3.1.
Features
- ๐ฅ Hot endpoints: add, change, disable and delete at runtime. The routing table swaps atomically.
- ๐งฉ Declarative binding: route, query, header, JSON body and form parameters with types, defaults and request names.
- ๐ File uploads:
multipart/form-datawith size and content-type limits, documented as binary in OpenAPI. - ๐ก๏ธ Validation: JSON Schema constraints, built-in formats (e-mail, URI, phone, IP, time), JsonLogic business rules and custom validators.
- ๐ช Filters: access checks before validation, your own error format, logging and metering of rejected requests.
- ๐ Localized errors: English and Polish built in, overridable texts, stable error codes.
- ๐ Drafts & history: publish changes now or at a set time, diff revisions, roll back.
- ๐ข Multi-tenancy: endpoints per tenant on the same routes, with a scoped manager, admin API, drafts, history and export/import.
- ๐งพ Audit log: who changed what and when, property by property, queryable through the admin API.
- ๐ Metrics & tracing: per-endpoint requests, validation failures by layer, processor duration and spans via
System.Diagnostics. - โ๏ธ Processors: validated input goes to your own, statically typed code with full DI.
- ๐ Built-in processors (opt-in): HTTP forward, webhook with retries and signatures, response templates.
- โฑ๏ธ Per-endpoint caching and rate limits:
Cache-Control, ETags, output caching, rate limits and quotas in the definition. - ๐ GitOps: stable export, import with upsert/sync and dry-run diffs, import from OpenAPI (processors per operation, mocks, re-import/sync), request snippets.
- ๐ OpenAPI 3.1: generated from the definitions, ready for Swagger UI, with security schemes, common headers and hooks.
- ๐ First-class endpoints: authorization policies, rate limiting and conventions work as usual.
- ๐ฆ Safe by design: no code execution, ReDoS-proof regexes, size limits, conflict detection.
- ๐ Analyzers: invalid routes, regexes, JsonLogic rules and processor types are reported at build time.
- ๐ชถ Zero third-party dependencies.
Quick start
builder.Services
.AddDynamicEndpoints()
.AddFromAssemblyContaining<Program>(); // processors, validators, seeders
var app = builder.Build();
app.MapDynamicEndpoints(); // the dynamic routes
app.MapDynamicEndpointsAdmin("/api/admin/endpoints") // management REST API
.RequireAuthorization("admin");
app.MapDynamicEndpointsOpenApi("/openapi/dynamic.json"); // OpenAPI 3.1
Define an endpoint from code (or let an admin do it through the API):
await manager.CreateAsync(DynamicEndpoint.Post("/orders")
.HandledBy<OrderProcessor, OrderConfig>(new() { Queue = "incoming" })
.FromHeader("tenantId", p => p.BindFrom("X-Tenant-Id").Required())
.FromBody("quantity", p => p.Integer().Required().Range(1, 100))
.FromBody("email", p => p.Email().Required())
.WithRule("""{ ">=": [{ "var": "quantity" }, 10] }""", "Wholesale orders only.", "quantity"));
[DynamicProcessor("orders")]
public sealed class OrderProcessor(IBus bus) : DynamicEndpointProcessor<OrderConfig>
{
protected override async Task<IResult> ProcessAsync(DynamicRequest request, OrderConfig config)
{
await bus.Send(config.Queue, request.Parameters, request.RequestAborted); // already bound & validated
return Results.Accepted();
}
}
The default store is in-memory. More packages:
| Package | |
|---|---|
| DynamicEndpoints.AdminUI | the admin panel, MapDynamicEndpointsAdminUI() |
| DynamicEndpoints.EntityFrameworkCore | persistence, history and drafts |
| DynamicEndpoints.FluentValidation | FluentValidation validators |
| DynamicEndpoints.PostgreSql ยท DynamicEndpoints.Redis | instant propagation across instances (LISTEN/NOTIFY, pub/sub) |
| DynamicEndpoints.OpenTelemetry | AddDynamicEndpointsInstrumentation() |
| DynamicEndpoints.Sql | read-only SQL query processor |
| DynamicEndpoints.Yaml | YAML for export, import and the OpenAPI import |
| DynamicEndpoints.Testing | in-memory store and test server |
| DynamicEndpoints.Cli | the dynamic-endpoints tool for GitOps |
| DynamicEndpoints.Templates | dotnet new dynamic-endpoints |
Learn more
- ๐ Documentation ยท Screenshots & sample app
- ๐ Changelog
- ๐ Issues
| 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. |
-
net10.0
- No dependencies.
NuGet packages (9)
Showing the top 5 NuGet packages that depend on DynamicEndpoints:
| Package | Downloads |
|---|---|
|
DynamicEndpoints.FluentValidation
Use FluentValidation validators as custom validators of DynamicEndpoints. |
|
|
DynamicEndpoints.EntityFrameworkCore
Entity Framework Core for DynamicEndpoints: persistence of definitions, and the ef-crud processor that exposes allowlisted entities as CRUD endpoints scaffolded from the EF model. |
|
|
DynamicEndpoints.PostgreSql
Instant propagation of DynamicEndpoints changes across instances through PostgreSQL LISTEN/NOTIFY. |
|
|
DynamicEndpoints.Redis
Instant propagation of DynamicEndpoints changes across instances through Redis pub/sub. |
|
|
DynamicEndpoints.Testing
Test helpers for DynamicEndpoints: in-memory store and notifications for WebApplicationFactory, and a ready-made test server. |
GitHub repositories
This package is not used by any popular GitHub repositories.