NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet
NuGet, #2285 most downloaded on NuGet
Swagger support for FastEndpoints.
Latest stable
8.3.0
Last release 3 months ago
20 Aug 2026
Ships fairly regularly
a new release about every 6 weeks
Nearly every release is documented
notes for 55 of the last 60 stable releases
44 versions withdrawn
withdrawn after publishing
127 years old
804 releases · first in 1900
Drag across the ruler to compare, or tap a release to open it.
Please join the discussion here and help out if you can.
Please join the discussion here and help out if you can.
<details><summary>'FastEndpoints.CommandRules' package for rule-based command dispatch</summary>
A new FastEndpoints.CommandRules package is now available for turning arbitrary input into one or more commands using small, ordered rules.
It's useful when an application event, webhook payload, request DTO, or domain object needs to fan out into different command-bus actions without putting branching logic in endpoints or handlers. Rules evaluate the input, build a command plan, and the dispatcher executes the selected commands immediately or queues them as jobs.
// map input model to a rule
bld.Services.AddCommandRules(o => o.Register<OrderPlaced, OrderPlacedRule>());
// define the rule to specify which commands should execute
sealed class OrderPlacedRule : CommandRule<OrderPlaced>
{
public override bool CanHandle(OrderPlaced input)
=> input.IsPaid;
public override IEnumerable<PlannedCommand> Build(OrderPlaced input)
{
yield return PlannedCommand.Create(new ReserveStock(input.OrderId));
if (input.SendReceipt)
{
yield return new PlannedCommand(new SendReceipt(input.OrderId))
{
Mode = CommandDispatchMode.QueueAsJob
};
}
}
}
// inject ICommandDispatcher<OrderPlaced> where the event/input is handled
await dispatcher.DispatchAsync(orderPlaced, ct);
</details>
<details><summary>Cached 'AppFixture' WAF disposal hook</summary>
AppFixture<TProgram> can now run final teardown once when its cached WebApplicationFactory<TProgram> is disposed at the end of a test assembly.
Override OnCachedWafDisposedAsync() in your fixture to clean up resources tied to the shared WAF instance. The hook runs after all fixture users are done, and requires cached WAF mode with [assembly: EnableAdvancedTesting].
sealed class App : AppFixture<Program>
{
protected override async ValueTask OnCachedWafDisposedAsync()
{
await ResetExternalResourceAsync();
}
}
</details>
<details><summary>Idempotency support for job queues</summary>
Job queues can now enforce business-key idempotency so the same logical action is only stored once. Configure a key selector per command type. When a non-empty key collides on the same queue, the duplicate is discarded with a warning log and QueueJobAsync returns the existing tracking id.
Requires the storage record to implement IHasIdempotencyKey and the storage provider to enforce uniqueness on QueueID + IdempotencyKey while the row exists (including completed jobs). On unique violation, throw DuplicateJobException with the existing tracking id. The library does not unwrap raw storage errors.
// enable idempotency for selected command types
app.UseJobQueues(o =>
{
o.IdempotencyKeyFor<ProcessOrderCommand>(c => c.OrderId);
o.IdempotencyKeyFor<ChargeCustomerCommand>(c => c.PaymentId.ToString("D"));
});
// storage record must implement IHasIdempotencyKey
sealed class JobRecord : IJobStorageRecord, IHasIdempotencyKey
{
public string? IdempotencyKey { get; set; }
...
}
// provider throws DuplicateJobException on unique violation
public async Task StoreJobAsync(JobRecord job, CancellationToken ct)
{
try
{
await db.SaveAsync(job, ct);
}
catch (/* unique index violation */)
{
var existing = await db.FindByQueueAndKeyAsync(job.QueueID, job.IdempotencyKey!, ct);
throw new DuplicateJobException(existing.TrackingID, job.IdempotencyKey, job.QueueID);
}
}
// first call stores the job; retries return the same tracking id
var trackingId = await new ProcessOrderCommand { OrderId = "ORD-42" }.QueueJobAsync();
Null/empty/whitespace keys from the selector are treated as no key and are not deduped. Uniqueness lasts until the row is purged. After delete, the same key may be reused.
</details>
<details><summary>gRPC reflection support for remote command handlers</summary>
Remote command handlers can now be discovered and described via standard gRPC server reflection, so grpcurl and Postman work against a handler server without a hand-authored .proto, and any protoc/buf toolchain can generate clients for non-dotnet consumers. It lives in the new opt-in FastEndpoints.Messaging.Remote.Reflection package.
Reflection describes a protobuf schema, so the server has to be speaking protobuf rather than the default MessagePack. The wire format is now pluggable via IRpcMarshallerFactory, and ProtobufMarshallerFactory is included. Command types need no protobuf attributes, and their public properties are mapped alphabetically and numbered from 1. The descriptors are generated from the very same model that serializes to the wire, so the published schema can't drift from the bytes.
// server: opt in to the protobuf wire format + reflection
bld.AddHandlerServer(marshaller: new ProtobufMarshallerFactory());
bld.Services.AddHandlerReflection();
app.MapHandlers(h => h.Register<MyCommand, MyCommandHandler, MyResult>());
app.MapHandlerReflection(); // returns a builder, so .RequireAuthorization() can be chained
// client: the matching wire format, set before registering anything
app.MapRemote("http://localhost:6000", c =>
{
c.MarshallerFactory = new ProtobufMarshallerFactory();
c.Register<MyCommand, MyResult>();
});
</details>
<details><summary>Export OpenAPI documents as '.http' files</summary>
The FastEndpoints.OpenApi package can now export generated OpenAPI documents as REST Client .http files, alongside the existing .json export, for quick manual testing of endpoints without leaving the editor.
await app.ExportHttpFilesAndExitAsync("v1"); // doc name should match .OpenApiDocument() config
dotnet run --export-http-files true
</details>
<details><summary>Skip executing endpoint handler if response already started</summary>
Endpoints can opt in to skip HandleAsync/ ExecuteAsync (and OnAfterHandle) when a response has already been started, for example from OnBeforeHandle*. Post-processors still run. Pre-processors already short-circuit without this setting.
public override void Configure()
{
Get("/resources");
DontExecuteHandlerIfResponseStarted();
}
// or globally:
app.UseFastEndpoints(c => c.Endpoints.Configurator = ep =>
{
ep.DontExecuteHandlerIfResponseStarted();
});
</details>
<details><summary>Attribute decorations are forwarded to every route of a multi-route endpoint</summary>
Class-level attributes that FastEndpoints doesn't interpret itself (such as [EnableCors], [EnableRateLimiting], [RequestFormLimits], or your own metadata attributes) are forwarded to the mapped endpoint's metadata so that ASP.NET middleware can see them. On an attribute-configured endpoint declaring more than one route, only the first route received them.
[HttpGet("orders/{id}", "purchases/{id}")] //the second route used to lose the attribute below
[EnableRateLimiting("fixed")]
sealed class MyEndpoint : EndpointWithoutRequest { ... }
Endpoints configured with a Configure() method were never affected. The endpoint definition is also no longer locked until all of its routes have been mapped.
</details>
<details><summary>Conditional FluentValidation presence rules no longer make OpenAPI properties required</summary>
FastEndpoints.OpenApi now preserves optional and nullable schema properties when NotNull() or NotEmpty() is guarded by a synchronous or asynchronous When(...)/Unless(...) condition.
Independent unconditional presence rules still mark the property as required and non-null as before.
</details>
<details><summary>Form file schemas are consistently emitted as binary in OpenAPI</summary>
FastEndpoints.OpenApi now emits IFormFile properties as type: string with format: binary, including items in IFormFileCollection, IEnumerable<IFormFile>, List<IFormFile>, and array schemas.
Suffixed or otherwise non-exact IFormFile schema references are also normalized before their components are removed, preventing dangling references in the generated document.
</details>
<details><summary>Nullable OpenAPI schemas with composition now emit valid null branches</summary>
FastEndpoints.OpenApi now emits valid OpenAPI 3.1 schemas for nullable arrays and nullable object references when composition keywords such as oneOf are involved.
Nullable arrays now inline the referenced array schema instead of combining type: ["null", "array"] with a non-null oneOf, and nullable object references now preserve null validity with an explicit null branch.
</details>
<details><summary>GET/HEAD root collection request bodies are optional in OpenAPI</summary>
FastEndpoints.OpenApi and FastEndpoints.Swagger now mark root collection request bodies (List<T> and T[]) as optional for GET and HEAD endpoints while preserving the generated array schema.
This matches runtime binding behavior where omitted GET/HEAD request bodies bind as empty collections, while non-collection request DTOs and other HTTP methods remain unchanged.
</details>
<details><summary>'415 Unsupported Media Type' responses for endpoints with implicitly-bound route params</summary>
Endpoints whose request DTO properties are bound to route values by name match alone (no [RouteParam] attribute) no longer receive a 415 Unsupported Media Type response for PUT/POST/PATCH requests sent without a body or Content-Type header.
public override void Configure() => Put("bookings/{BookingId}/pause");
public sealed class PauseBookingRequest
{
public long BookingId { get; set; }
}
Previously, only properties decorated with [RouteParam] (or another attribute deriving from NonJsonBindingAttribute) were recognized as not requiring a JSON body, so a route-param-only DTO like the one above incorrectly demanded a Content-Type header.
</details>
<details><summary>Indexer properties no longer break request binding and validation</summary>
Public indexers are excluded from the bindable-property set (and from the reflection source generator cache), so types that declare one no longer throw when compiling getters/setters.
Previously an indexer was treated as a bindable property, which failed endpoint registration, nested [FromForm]/[FromQuery] binding, data-annotation validation recursion, and shapes such as List<List<T>> whose element type exposes Item[int].
</details>
<details><summary>Configure versioned OpenAPI documents from <code>AddVersioning</code></summary>
On .NET 10, AddVersioning accepts an optional third argument of type Action<VersionedOpenApiOptions>, letting consumers configure the versioned OpenAPI documents from the Asp.Versioning.OpenApi package, whose per-version document services are required by MapOpenApi().WithDocumentPerVersion().
services.AddVersioning(
o =>
{
o.ApiVersionReader = ApiVersionReader.Combine(new UrlSegmentApiVersionReader());
},
o =>
{
o.GroupNameFormat = "'v'VVV";
o.SubstituteApiVersionInUrl = true;
},
o => o.Document.AddDocumentTransformer(
(document, _, _) =>
{
document.Info.Title = "My API";
document.Info.Description = "My API description";
return Task.CompletedTask;
}));
The argument is optional, so existing callers of AddVersioning are unaffected. The new parameter is only available on .NET 10 targets because Asp.Versioning.OpenApi itself does not ship for earlier frameworks.
</details>
<details><summary>Kiota client generation uses Microsoft.OpenApi.Kiota.Builder 1.29.1</summary>
FastEndpoints.OpenApi.Kiota and FastEndpoints.ClientGen.Kiota now ship with Microsoft.OpenApi.Kiota.Builder 1.29.1, a security-only backport that stays on the Microsoft.OpenApi 2.x line compatible with Microsoft.AspNetCore.OpenApi.
This release patches Kiota codegen injection and path-resolution CVEs without requiring a breaking OpenAPI 3.x bump. Newer Kiota 1.30+ builds remain incompatible until ASP.NET OpenAPI itself moves to OpenAPI 3.x.
</details>
<details><summary>Faster assembly scanning at startup</summary>
Reflection based type discovery no longer builds a LINQ set of the wanted interface types for every single type it inspects, which is the bulk of the work AddFastEndpoints() / AddMessaging() do at startup (measured on a 5 interface discovery: 180ns and 448 bytes per inspected type, down to 66ns and 35 bytes). The assembly exclusion list is also matched with an ordinal string comparison now, instead of a culture sensitive one that went through ICU collation per assembly.
</details>
<details><summary>Idempotency policy avoids a per-request LINQ scan of endpoint metadata</summary>
IdempotencyPolicy (registered as an ASP.NET output-cache base policy, so it runs on every request) no longer looks up the endpoint's EndpointDefinition with Metadata.OfType<EndpointDefinition>().SingleOrDefault(), which allocates an enumerator and walks the whole metadata collection. It now uses Metadata.GetMetadata<EndpointDefinition>(), the same cached-per-type lookup already used elsewhere in the request pipeline.
</details>
<details><summary>Response cache header value is built once per endpoint</summary>
The Cache-Control value of a response cached endpoint is no longer re-interpolated on every request. Both of its inputs (the configured ResponseCacheLocation and duration) are fixed after startup, so the value is now built on the first request to the endpoint and reused, removing a string interpolation plus an int.ToString() per request. The emitted headers are unchanged.
</details>
<details><summary>MCP addon targets Model Context Protocol SDK v2</summary>
FastEndpoints.Mcp now depends on ModelContextProtocol.AspNetCore 2.0 (2026-07-28 MCP spec). HTTP transport is stateless by default; existing AddMcp() / tool wiring is unchanged.
</details>
<details><summary>AccessControl group names resolve compile-time constants</summary>
The source generator that builds Allow permission groups from AccessControl(...) calls now accepts compile-time string constants for group names (const fields, nameof(...), etc.), not only string literals.
static class PermissionGroup
{
internal const string Admin = nameof(Admin);
}
public override void Configure()
{
Put("/inventory/manage/update");
AccessControl("Inventory_Update_Item", PermissionGroup.Admin);
}
Previously, non-literal group arguments were ignored, so the generated permission was omitted from groups such as Allow.Admin.
</details>
<details><summary>Refresh token service support for union-type returning endpoints</summary>
A new CreateTokenWith<TService, TTokenResponse>() overload lets endpoints that return a union-type result (e.g. Results<Ok<TokenResponse>, UnauthorizedHttpResult>) create access/refresh token pairs, by decoupling the token response type from the endpoint's response type.
</details>
<details><summary>Frozen lookup caches for hot paths</summary>
Several read-mostly internal lookup tables now use FrozenDictionary/FrozenSet after startup construction, improving repeated lookup performance in request binding, access-control generation, and OpenAPI/Swagger metadata processing without changing public APIs.
Endpoint security policies now build a FrozenSet of allowed permissions/scopes/claim types once when the policy is constructed, instead of scanning the backing collection on every authorization check.
RequestBinder<TRequest> now indexes [FromClaim] / [HasPermission] properties once per DTO type and matches principal claims against those indices, instead of building per-request claim dictionaries or permission sets sized to the full principal.
</details>
<details><summary>Reduced allocations when sending byte arrays and empty json objects</summary>
Send.BytesAsync() no longer builds its own async state machine and Task<Void>, since it simply forwards to Send.StreamAsync(), which already owns disposal of the supplied stream.
Send.EmptyJsonObject() now serializes a shared empty JsonObject instead of allocating a new one per call. The response still goes through the configured response serializer, so custom serializer hooks are unaffected.
</details>
<details><summary>Relaxed agent name validation</summary>
A2A skill ids and MCP tool names now allow dots and forward slashes, so path/version-style identifiers such as users/read.v1 can be published without renaming.
Some external MCP adapters may still apply OpenAI-style function-name validation and reject dots or slashes.
</details>
<details><summary>Reduced allocations when sending streams and files</summary>
Send.StreamAsync() and Send.FileAsync() no longer allocate a typed response-header wrapper when no lastModified value is supplied, no longer allocate an array to compute the request's precondition state, and no longer build a second stream-disposal state machine, since the stream is already disposed by Send.StreamAsync() itself.
</details>
<details><summary>Connection-level subscriber ids for remote event subscriptions</summary>
Remote connections can now set SubscriberID once and use it as the default subscriber id for event subscriptions on that connection.
app.MapRemote("http://localhost:6000", c =>
{
c.SubscriberID = "worker-a";
c.Subscribe<SomethingHappened, WhenSomethingHappens>();
});
Subscription-specific ids still take precedence, so SubscribeWithExplicitId(...) can override the connection-level default when needed.
</details>
<details><summary>Unified complex form and query binding</summary>
Complex [FromForm] and [FromQuery] object binding now share a single recursive binder (ComplexSourceBinder) with small source adapters for form fields/files and query params. Behavior is unchanged for nested objects, collections, form files, and validation failures. The old split implementations are removed so edge-case fixes land in one place.
</details>
<details><summary>Cached metadata for complex form/query binding</summary>
ComplexSourceBinder now lazily caches per-property binding metadata (field names, type kind flags, setters, value parsers, and List<T> factories) on the existing reflection cache. Nested form and query graphs no longer re-run attribute lookup, type classification, or MakeGenericType on every request. Behavior is unchanged; only the hot path is cheaper after first use.
</details>
<details><summary>Shared service-resolver facade for endpoints, mappers, and validators</summary>
The eight Resolve / TryResolve / CreateScope pass-throughs that were duplicated on Endpoint, Group, mappers, Validator, BinderContext, and HttpContext extensions now live in a single Core type, ServiceResolverClient (with an internal static Forward helper for types that cannot inherit it).
Public resolve APIs and behavior are unchanged. Only the ownership of the default DI facade is centralized so future resolver changes land in one place.
</details>
<details><summary>Fewer allocations in complex query and form binding</summary>
Complex [FromQuery] / [FromForm] binding allocates less on each request:
ParentPrefixIndex (used to skip nested objects with no matching keys) no longer materializes every parent path substring into a HashSet. It indexes spans into the original query/form keys in a single pass (capacity from key count, grows on unique prefixes only), keeping O (1) prefix checks without per-segment string allocations.prefix.field, key[i]) uses string.Concat / string.Create instead of repeated interpolations.items[i] prefix without allocating empty element instances.Behavior is unchanged for nested DTOs, collections, form files, and validation failures. The win shows up as lower gen-0 traffic on nested query/form graphs (for example the query-binding benchmark path).
</details>
<details><summary>One less allocation per request in the endpoint execution path</summary>
The internal ValidationFailed helper in the endpoint execution path no longer closes over the enclosing locals, which previously made the compiler heap allocate a closure on every request even though the helper only runs when binding or validation fails. Measured saving is 48 bytes per request on 64 bit. Behavior is unchanged.
</details>
<details><summary>Allocation-free event bus dispatch for the common case</summary>
EventBus<TEvent> no longer dispatches via Parallel.ForEachAsync; handlers are invoked directly and awaited with Task.WhenAll, with a single-handler fast path that is allocation-free for the default WaitForAll case. Multi-handler and WaitForNone/WaitForAny paths also allocate less; PublishFilteredAsync reuses the registered array for identity/empty filters. Handlers are no longer capped at Environment.ProcessorCount (all start immediately). WaitForNone remains fire-and-forget (offloaded).
</details>
<details><summary>Warmup precompiles complex form/query binding metadata</summary>
Endpoints.Warmup() now precompiles ComplexSourceBinder metadata (setters, parsers, factories, type flags) for the full object graph under each [FromForm] / [FromQuery] property, not only the request DTO's own properties and validation getters.
Roots are taken from the request DTO itself, so warmup still covers them when a custom IRequestBinder<TRequest> is registered. First-request lock contention on the per-property cache is avoided as a result.
</details>
<details><summary>Fewer allocations encoding/decoding x402 payment payloads</summary>
X402Serializer no longer round-trips through an intermediate UTF-16 string when base64 encoding or decoding payment payloads. Encoding serializes directly to UTF-8 bytes, and decoding deserializes straight from the decoded byte span. Behavior is unchanged; each direction does one less allocation per x402-protected request.
</details>
<details><summary>'FastEndpoints.Testing' requires xUnit.net v3 4.0</summary>
FastEndpoints.Testing now depends on xunit.v3.extensibility.core 4.0. Test projects that use this package must align on xunit.v3 4.0 or later.
If you run tests with dotnet test on the .NET 10 SDK, add this to the solution-root global.json (one file for the repo, not per project):
{
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
If you run dotnet test on the .NET 8 or 9 SDK, VSTest is still the default. Keep xunit.runner.visualstudio 4.0 and Microsoft.NET.Test.Sdk, or drop the adapter and set <TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport> for MTP.
That runner setup is an xUnit 4 / SDK requirement, not something FastEndpoints.Testing sets. It is not needed for Rider, Visual Studio Test Explorer, running the test executable directly, or xunit.v3.mtp-off. See Microsoft Testing Platform (xUnit.net v3).
</details>
<details><summary>Nested collections are rejected in complex form/query binding</summary>
Complex [FromForm] / [FromQuery] binding now throws NotSupportedException when a collection's element type is itself a complex collection (e.g. List<List<Item>>, List<byte[]>, List<Dictionary<TKey, TValue>>), instead of returning an empty list or failing with an unrelated indexer error.
These shapes have no key convention and never bound data. Simple collections such as List<string> and List<int> are unaffected.
</details>
Your coding agent can read these notes before it upgrades. Set up the MCP server →
The above discontinued packages will be deprecated after .NET 9 goes out of support.
Please join the discussion here and help out if you can.
<details><summary>New 'FastEndpoints.OpenApi' package based on 'Microsoft.AspNetCore.OpenApi'</summary>
Starting with v8.2, the FastEndpoints ecosystem has switched from NSwag/Newtonsoft based Swagger/OpenAPI document generation to the more modern and Native AOT friendly Microsoft.AspNetCore.OpenApi based document generation library. Integration is provided via a new FastEndpoints.OpenApi package which corrects a few issues with the MS package as well as doing a lot of post-processing on the document model to bring feature parity with the FastEndpoints.Swagger package.
There's no immediate need for you to switch to the new package if your projects are heavily invested in NSwag based generation. Especially if you're not yet on .NET10. The new package only supports .NET10+ projects. See EOL notice below for more info.
</details>
<details><summary>Streaming command handlers for the command bus</summary>
The in-process command bus can now execute commands that return IAsyncEnumerable<T> streams by implementing IStreamCommand<TResult> and IStreamCommandHandler<TCommand, TResult>.
Streaming commands use the same ExecuteAsync() extension method as regular commands, support their own middleware pipeline via IStreamCommandMiddleware<TCommand, TResult>, and can be used with closed or generic command handler registrations.
</details>
<details><summary>x402 Payment support for endpoints</summary>
Endpoints can now require x402 payments by calling RequirePayment(...) inside Configure().
Global x402 defaults are configured with builder.AddX402() and app.UseX402(...), and the middleware only runs for endpoints that opt in. The initial release supports the exact scheme with a single accepted payment option per endpoint and uses the safer default flow of verifying first, executing the handler, and settling only after a successful response.
</details>
<details><summary>New 'FastEndpoints.Mcp' and 'FastEndpoints.A2A' agent integration packages</summary>
Two new beta packages are now available for exposing your existing FE endpoints to AI agent runtimes without having to build separate agent-specific controllers or handlers.
FastEndpoints.Mcp exposes opt-in endpoints as Model Context Protocol (MCP) tools over HTTP using the official MCP ASP.NET Core transport.
FastEndpoints.A2A exposes opt-in endpoints as A2A skills with an agent card and JSON-RPC SendMessage dispatcher.
Both addons execute the normal FastEndpoints pipeline in-process, including binding, validation, pre/post processors and response serialization. Nothing is exposed by default. Endpoints must explicitly opt in via this.McpTool(...), [McpTool], this.A2ASkill(...), or [A2ASkill], and each package has separate agent-facing visibility filters so REST authorization and agent visibility can be configured independently.
bld.Services
.AddFastEndpoints()
.AddMcp()
.AddA2A();
app.UseFastEndpoints()
.UseMcp()
.UseA2A();
</details>
<details><summary>Generate a hydrated test URL from an endpoint type and request DTO</summary>
Testing extensions now expose GetTestUrlFor<TEndpoint>(object request) publicly. This lets you resolve the final routeless test URL for an endpoint without actually sending the request. Route parameters are populated from the supplied DTO instance, query string values are appended automatically, and the method also works in Aspire-style black-box tests by loading the endpoint URL cache over HTTP when necessary.
This is useful when you want to inspect or assert the exact URL that a test request would use before calling GETAsync(), POSTAsync(), etc.
var request = new UpdateInvoiceRequest
{
InvoiceId = 123,
IncludeLines = true
};
var url = client.GetTestUrlFor<UpdateInvoiceEndpoint>(request);
url.ShouldBe("api/invoices/123?IncludeLines=true");
</details>
<details><summary>'ProblemDetails' support for the built-in exception handler</summary>
The built-in exception handler can now emit the RFC9457 compatible ProblemDetails response shape for unhandled exceptions by enabling useProblemDetails when registering it.
This lets validation failures and unhandled exception responses share the same standards compliant error contract when the app is configured with c.Errors.UseProblemDetails().
app.UseDefaultExceptionHandler(useProblemDetails: true)
.UseFastEndpoints(c => c.Errors.UseProblemDetails());
</details>
<details><summary>Partial static properties in a partial 'Allow' classes are now source generated</summary>
You can now declare public static partial string properties in a partial Allow class without providing an implementation. The FastEndpoints.Generator package detects these declarations and generates the property body with the same computed permission code that would be produced if the permission were defined directly on an endpoint via AccessControl(...).
public static partial class Allow
{
public static partial string Inventory_Create { get; }
public static partial string Inventory_Update { get; }
}
The generator emits the implementations automatically:
public static partial string Inventory_Create { get => "A1B"; }
public static partial string Inventory_Update { get => "C3D"; }
The generated permission codes are stable (derived from the property name via a SHA256-based hash), so they survive refactors as long as the property name stays the same.
</details>
<details><summary>Supply source generated type lists directly to startup configuration methods</summary>
AddFastEndpoints, AddMessaging, and AddJobQueues now each have a new overload that accepts one or more List<Type> values (one per referenced assembly), making it possible to use the FastEndpoints.Generator package with the Messaging as well as the JobQueue package when the main FastEndpoint package is not used.
Before:
builder.Services.AddFastEndpoints(o =>
{
o.SourceGeneratorDiscoveredTypes.AddRange(MyAssembly.DiscoveredTypes.All);
});
After:
// single assembly
builder.Services.AddFastEndpoints(DiscoveredTypes.All);
// multiple assemblies
builder.Services.AddFastEndpoints(Lib1.DiscoveredTypes.All, Lib2.DiscoveredTypes.All);
The same pattern applies when using Messaging or JobQueues as standalone libraries (i.e. without AddFastEndpoints):
// Messaging only
builder.Services.AddMessaging(DiscoveredTypes.All);
// JobQueues only
builder.Services.AddJobQueues<Job, JobStorage>(DiscoveredTypes.All);
The two overloads are intentionally separated since source-generated and reflection-based discovery are mutually exclusive strategies and prevents accidental use of both paths at once.
If AddFastEndpoints is already called with the discovered types, AddMessaging and AddJobQueues do not need them passed again. Use the parameterless overloads for those calls.
</details>
<details><summary>Keyed service support for source generated endpoint property injection</summary>
Endpoint properties decorated with [KeyedService] are now supported when using source generated reflection metadata.
The generator records the keyed-service key for endpoint property injection, allowing generated reflection caches to resolve those properties with GetRequiredKeyedService(...) instead of falling back to the unkeyed service registration.
</details>
<details><summary>Opt-in startup warmup for endpoints, validators, mappers, and event buses</summary>
Call Warmup() from UseFastEndpoints(...) to eagerly initialize validators, mappers, request binders, and compiled property setter/getter delegates so the first real requests do not pay the cold-start cost.
Warmup can be scoped to a subset of endpoints with the optional filter argument:
app.UseFastEndpoints(c =>
{
c.Endpoints.Warmup(def => def.EndpointType.Namespace?.StartsWith("MyApp.CriticalEndpoints") is true);
});
When a filter is not provided, all registered endpoints are warmed up after Warmup() is called. Pass _ => false to skip endpoint warmup entirely.
Messaging warmup is also opt-in. Call Warmup() from UseMessaging(...) to eagerly resolve event bus instances:
app.Services.UseMessaging(o => o.Warmup());
Job queue startup can request the same messaging warmup through UseJobQueues(...):
app.UseJobQueues(o => o.Warmup());
</details>
<details><summary>HTTP QUERY method support</summary>
Endpoints can now be configured for the RFC 10008 QUERY method using the fluent Query(...) setup helper, the new [HttpQuery(...)] attribute, or Verbs(Http.QUERY).
QUERY endpoints are registered with the literal QUERY HTTP method and bind request bodies like POST/PUT/PATCH. Body DTOs default to application/json, so missing or unsupported Content-Type values use the existing 415 validation path. QUERY is treated as a safe method by antiforgery middleware.
Testing extensions also include QUERYAsync(...) helpers. OpenAPI document generation remains valid. Current OpenAPI 3.x tooling drops unknown QUERY operations, so QUERY endpoints are omitted from generated documents until the underlying OpenAPI stack can represent them.
</details>
<details><summary>'AppFixture' concurrent WebApplicationFactory host build issue</summary>
AppFixture now builds the cached WebApplicationFactory host while the shared initializer is still serialized. This prevents parallel first-use test fixtures from each triggering their own lazy host build through CreateClient(), avoiding races during FastEndpoints startup configuration.
</details>
<details><summary>'ValidationSchemaProcessor' concurrency issue when generating multiple Swagger documents</summary>
The _childAdaptorValidators instance field on the singleton ValidationSchemaProcessor was a plain non-thread-safe Dictionary<string, IValidator>. Concurrent Swagger document generation (e.g. multiple documents being built in parallel at startup) could cause race conditions on that shared dictionary. The field is now a local variable scoped to each Process call, eliminating shared mutable state entirely.
</details>
<details><summary>Asymmetric JWT signing key updates no longer leak RSA handles</summary>
Updating asymmetric JWT signing keys at runtime no longer keeps undisposed RSA instances alive after each key rotation. The validation key is now built from exported public key parameters instead of holding on to the temporary RSA instance used for import, avoiding unmanaged crypto handle leaks without disposing keys that may still be in use by concurrent token validations.
</details>
<details><summary>'DateOnly','TimeOnly' not binding correctly from nested '[FromQuery]' DTOs</summary>
Complex query/form binding now treats DateOnly, TimeOnly, Half, Int128, UInt128, BigInteger, IPAddress, and IPEndPoint as scalar values instead of recursively binding them as complex objects.
This fixes nested [FromQuery] request DTO properties such as DateOnly? and TimeOnly? being left at their default values (0001-01-01, 00:00:00, etc.) even when valid query string values were supplied.
</details>
<details><summary>'FastEndpoints.Swagger' nested validator issue</summary>
When a request DTO used a child validator (via SetValidator(...) / RuleFor(x => x.Child).SetValidator(...)), the property-level constraints defined in that child validator (such as NotEmpty, MaxLength, InclusiveBetween, etc.) were silently dropped from the generated Swagger schema for any request type processed after the first one that shared the same nested validator type.
The root cause was that ValidationSchemaProcessor kept a _childAdaptorValidators dictionary as a singleton-level instance field. This dictionary is used to track already-seen child validator types to prevent infinite recursion. Because it was shared across all schema processing calls, a nested validator type recorded while processing request type A would be treated as "already seen" when encountered again during processing of request type B, and its rules would not be applied to B's schema.
</details>
<details><summary>Job queue scheduling now rejects impossible execution windows</summary>
Queued jobs now fail fast with an ArgumentException when the effective expiration time is not later than the scheduled execution time. This includes the default 4-hour expiration window, preventing deferred jobs from being stored with an empty eligibility window where they could never be picked up for execution before becoming stale.
</details>
<details><summary>Serializer options are now configured once per process during startup</summary>
FastEndpoints now performs its process-wide serializer configuration under a one-time startup lock. This prevents parallel host creation in the same process, such as WebApplicationFactory based integration tests, from re-pointing and mutating the shared JsonSerializerOptions instance while another host is already serializing requests or responses.
This keeps the existing process-global configuration model: the first FastEndpoints startup configures the shared serializer options and later hosts in the same process reuse that configuration instead of reconfiguring it.
</details>
<details><summary>Access control permission lookup data is now source generated</summary>
The Allow source generator now emits the permission name/code lookup initialization directly, avoiding runtime reflection when access control permissions are first used.
</details>
<details><summary>Source generated reflection data now avoids object factories for partial request DTOs</summary>
The reflection source generator no longer emits direct object factory expressions for partial request DTO types. This avoids compile-time failures when another source generator augments the same partial type into an abstract base type, such as discriminated-union libraries that generate abstract union roots and concrete nested variants.
Property metadata is still generated for those DTOs, so binding and validation can continue using source generated reflection data without trying to instantiate a type that may become abstract later in the generator pipeline.
</details>
<details><summary>Deeply nested [FromForm] DTOs with files now work with routeless test helpers</summary>
The routeless HttpClient testing extensions can now build multipart/form-data requests from nested [FromForm] DTOs containing IFormFile, file collections, scalar collections, and complex child objects. Root [FromForm] wrappers are still promoted to top-level form fields, while nested values use the dotted/indexed field names expected by the binder, such as Details.Image and Items[0].Attachment.
The generated form data also respects binding source metadata by skipping route, query, header, cookie, claim, permission, and [DontBind] fields that should not be sent as form fields. Circular object graphs are detected up front and fail with a clear NotSupportedException instead of recursing forever.
</details>
<details><summary>More lenient route prefix handling</summary>
Global route prefixes now normalize empty-string configuration values to no prefix and trim surrounding / characters before route registration. This fixes cases where configuration APIs return "" instead of null while preserving the existing RoutePrefixOverride(...) contract, including ignoring endpoint-level overrides when no global prefix is configured and allowing RoutePrefixOverride(string.Empty) to disable the global prefix for a single endpoint.
</details>
<details><summary>Configurable response deserialization behavior for routeless test helpers</summary>
The routeless HttpClient testing extensions no longer hardcode JsonUnmappedMemberHandling.Disallow when deserializing response DTOs. You can now control that behavior with c.Serializer.TestResponseUnmappedMemberHandling, while defaulting to strict failure when the response JSON contains properties your test DTO does not define.
To allowing unmapped members during test response deserialization:
using System.Text.Json.Serialization;
app.UseFastEndpoints(c =>
{
c.Serializer.TestResponseUnmappedMemberHandling = JsonUnmappedMemberHandling.Skip;
});
</details>
<details><summary>Emit wrapped JSON Patch request bodies as top-level patch operation arrays in OpenApi docs</summary>
When a request DTO contains a [FromBody] property accepted as application/json-patch+json, the generated OpenAPI request body schema is now promoted from the wrapper object shape to the top-level JSON Patch array shape expected by Swagger UI.
This improves the generated example payload from:
{
"operations": [
{
"path": "string",
"op": "string",
"from": "string",
"value": "string"
}
]
}
to:
[
{
"path": "string",
"op": "string",
"from": "string",
"value": "string"
}
]
</details>
<details><summary>Undefined enum values are now rejected by default during non-JSON model binding</summary>
Route/query/form/header/cookie/claim binding now rejects enum values that are not explicitly defined by the target enum type. This closes a gap where numeric inputs such as 99 could be parsed into an enum even when that numeric value was not a declared member.
If you need to disable the new behavior and allow undefined enum values again, enable AllowUndefinedEnumValues explicitly:
app.UseFastEndpoints(c =>
{
c.Binding.AllowUndefinedEnumValues = true;
});
</details>
<details><summary>Malformed multipart form requests now fail as validation errors instead of server errors</summary>
Multipart form binding now treats request body parsing failures caused by malformed client input as validation failures. Truncated multipart bodies and invalid Content-Disposition headers are caught when no custom FormExceptionTransformer is configured, returning a 400 Bad Request response instead of surfacing as unhandled 500 Internal Server Error exceptions.
This avoids noisy false-positive security scanner findings and keeps genuinely unexpected exceptions propagating normally, while still allowing applications with a custom FormExceptionTransformer to control their own form parsing error behavior.
</details>
<details><summary>'Send.OkAsync(ct)' no longer tries to serialize cancellation tokens on untyped endpoints</summary>
When an endpoint response type is object such as with EndpointWithoutRequest, calling Send.OkAsync(ct) could previously bind to the response-body overload and end up passing the CancellationToken to STJ for serialization.
That case is now detected at runtime and routed to the no-body 200 OK path instead, avoiding the serialization failure while preserving the existing overload surface.
public class PingEndpoint : EndpointWithoutRequest
{
public override void Configure()
=> Get("/ping");
public override Task HandleAsync(CancellationToken ct)
=> Send.OkAsync(ct);
}
</details>
<details><summary>NSwag based Swagger packages are set to be discontinued</summary>
The following NSwag based packages will no longer be receiving new features:
FastEndpoints.Swagger (main swagger doc generation library)FastEndpoints.ClientGen (NSwag based api client generation)FastEndpoints.ClientGen.Kiota (NSwag+Kiota based api client generation)There is no immediate need for you to migrate away from these packages to the Microsoft.AspNetCore.OpenApi based new ones, as they will continue to receive bug fixes for the time being. Migration is not that difficult either, as the new packages purposefully contain extremely close API surfaces. If you have no deep customization with stuff like custom newtonsoft converters, operation/schema processors, etc; migration should not be too difficult.
The new FastEndpoints.OpenApi* packages are however .NET 10+ only. If you'd like to migrate to the new packages, you'd have to migrate your projects to .NET 10 first. The above discontinued packages will be deprecated after .NET 9 goes out of support.
</details>
<details><summary>Dropped support for netstandard2.1</summary>
FastEndpoints.Core, FastEndpoints.Messaging.Core, and FastEndpoints.Messaging.Remote.Core no longer target netstandard2.1 and now support net8.0+ only.
If you consume these packages from shared libraries or older applications, retarget those projects to net8.0 or newer before upgrading.
</details>
<details><summary>'SourceGeneratorDiscoveredTypes' removed from 'EndpointDiscoveryOptions'</summary>
The EndpointDiscoveryOptions.SourceGeneratorDiscoveredTypes property has been removed. Pass the source-generated type list directly to AddFastEndpoints instead — see above.
// before
builder.Services.AddFastEndpoints(o =>
{
o.SourceGeneratorDiscoveredTypes.AddRange(DiscoveredTypes.All);
});
// after
builder.Services.AddFastEndpoints(DiscoveredTypes.All);
</details>
<details><summary>Undefined enum values are no longer accepted by default for non-STJ model binding</summary>
The default behavior for non-JSON model binding has changed. Previously, enum values were accepted as long as Enum.TryParse() succeeded, which meant undefined numeric values could still bind successfully. The new default rejects enum values unless they are explicitly defined by the target enum type.
This may break existing endpoints that rely on accepting undefined numeric enum values from route/query/form/header/cookie/claim inputs.
Do the following to revert to the previous behavior:
app.UseFastEndpoints(c =>
{
c.Binding.AllowUndefinedEnumValues = true;
});
</details>
Due to low financial backing by the community, FastEndpoints will soon be going into "Bugfix Only" mode until the situation improves. Please join the
Due to low financial backing by the community, FastEndpoints will soon be going into "Bugfix Only" mode until the situation improves. Please join the discussion here and help out if you can.
<details><summary>Dual mode testing support for 'AppFixture'</summary>
You can now use the same app fixture (without any conditional code in your tests) to run WAF based tests during regular development, and run smoke tests against a native aot build during a CI/CD pipeline run by simply doing dotnet test MyTestProject.csproj -p:NativeAotTestMode=true in the pipeline. This way you are able to have a faster feedback loop during development and also verify that everything works the same once the app is built with native aot by running the same set of tests against the aot build without any special handling in your code. See the documentation here.
</details>
<details><summary>Fluent generics support for serializer context generator</summary>
The STJ serializer context generator now supports endpoints defined with fluent generics.
</details>
<details><summary>Referenced project + Nuget package support for the serializer context generator</summary>
The generated serializer context will now have JsonSerializable attributes for request and response DTOs from referenced source projects as well as Nuget packages. Previously the generator was only capable of generating attributes for DTOs from the current project directory.
</details>
<details><summary>Ability to configure a pre-determined list of "known subscribers" for remote event queues</summary>
Remote event subscribers can now supply an explicit subscriberID instead of relying on the auto generated client identity, and event hubs can be configured with a known list of subscriber IDs to begin queuing events for them from app startup onward. Known subscriber pre-seeding does not affect round-robin mode, which still delivers only to currently connected subscribers.
</details>
<details><summary>Stack overflow issue with .NET 8 and 9</summary>
A stack overflow exception was being thrown in .NET 8/9 due to cyclical calls in TypeInfoResolver, which .NET 10 has solved. We've added a workaround to prevent this from happening.
</details>
<details><summary>Serializer context generator was skipping collection DTO types</summary>
The serializer context generator tool was not creating JsonSerializable attributes for request and response DTO types if they were collection types such as List<Request>, IEnumerable<Response>, etc.
</details>
<details><summary>Job queue storage provider query translation issue</summary>
The job queue search predicate has been improved to allow EF Core (and potentially other ORMs) to translate the expression correctly when the storage provider is configured in non-distributed mode. Previously, an unmapped DequeueAfter property was included in the expression causing EF Core translation errors.
</details>
<details><summary>Regression in OData library</summary>
Due to recent changes in FastEndpoints v8, the OData library stopped producing results. This has now been fixed, and comprehensive tests added to prevent a reoccurrence.
</details>
<details><summary>Prune stale remote event hub subscribers after 24 hours</summary>
Remote event hubs now stop creating event records for disconnected subscribers that have not been seen for 24 hours. This keeps temporarily disconnected subscribers eligible to receive queued events when they reconnect, while preventing dead subscribers from accumulating new records indefinitely.
</details>
<details><summary>Remote event queue persistence retry handling</summary>
The publisher event hub and remote event subscriber now retry only the actual event storage operations and perform their semaphore wake-up signaling separately. This avoids re-persisting already stored event records if the post-store notification step fails.
</details>
<details><summary>Optimize serializer context generator</summary>
The serializer context generator has been improved to use less resources and do the generation in a more efficient and faster manner.
</details>
<details><summary>Custom value parser registration internals</summary>
v8 matches custom value parsers by the underlying type (due to native aot intricacies) and if a user would register the parser with the nullable type, it would not match. This has been solved by always registering the underlying type even if the user supplies a nullable type.
</details>
<details><summary>Job queue executor refilling and shutdown behavior</summary>
Job queue executors now refill newly freed concurrency slots immediately instead of waiting for the whole fetched batch to finish. During shutdown, the executor also drains already running jobs before exiting, and distributed storage providers only claim as many jobs as there are currently available execution slots.
</details>
<details><summary>Remote event queue executor refilling with stable event record IDs</summary>
Remote event storage records now carry a library generated TrackingID, which allows event subscribers to refill newly freed execution slots immediately without re-scheduling the same in-flight durable record. This improves concurrency utilization for persistent remote event queues, especially when a slow handler would otherwise hold up the next batch.
</details>
<details><summary>Remote event storage records now require a TrackingID</summary>
The IEventStorageRecord contract now includes a Guid TrackingID property. If you maintain custom persistent event storage record types for remote event hubs or subscribers, you must add this property to your record models and map/persist it in storage. The library will automatically populate the value when creating new event records. This was a necessary addition in order to maximize concurrency utilization.
</details>
…of queries in certain scenarios. Please see the breaking changes section below as one of the methods of IJobStorageProvider needs a minor change.
Due to low financial backing by the community, FastEndpoints will soon be going into "Bugfix Only" mode until the situation improves. Please join the discussion here and help out if you can.
<details><summary>Support for Native AOT compilation</summary>
FastEndpoints is now Native AOT compatible. Please see the documentation here on how to configure it.
If you'd like to jump in head first, a fresh AOT primed starter project can be scaffolded like so:
dotnet new install FastEndpoints.TemplatePack
dotnet new feaot -n MyProject
If you've not worked with AOT compilation in .NET before, it's highly recommended to read the docs linked above.
</details>
<details><summary>Auto generate STJ JsonSerializationContexts</summary>
You no longer need to ever see a JsonSerializerContext thanks to the new serializer context generator in FastEndpoints. (Unless you want to that is 😉). See the documentation here on how to enable it for non-AOT projects.
</details>
<details><summary>Distributed job processing support</summary>
The job queueing functionality now has support for distributed workers that connect to the same underlying database. See the documentation here.
</details>
<details><summary>Qualify endpoints in global configurator according to endpoint level metadata</summary>
You can now register any object as metadata at the endpoint level like so:
sealed class SomeObject
{
public int Id { get; set; }
public bool Yes { get; set; }
}
sealed class MetaDataRegistrationEndpoint : EndpointWithoutRequest
{
public override void Configure()
{
Get("/test-cases/endpoint-metadata-reg-test");
Metadata(
new SomeObject { Id = 1, Yes = true },
new SomeObject { Id = 2, Yes = false });
}
}
and configure endpoints conditionally at startup according to the endpoint level metadata that was added by the endpoint configure method:
app.UseFastEndpoints(
c => c.Endpoints.Configurator =
ep =>
{
if (ep.EndpointMetadata?.OfType<SomeObject>().Any(s => s.Yes) is true)
ep.AllowAnonymous();
})
</details>
<details><summary>Response sending method 'NotModifiedAsync'</summary>
A new response sending method has been added for sending a 304 status code response.
public override async Task HandleAsync(CancellationToken c)
{
await Send.NotModifiedAsync();
}
</details>
<details><summary>Index out of range exception in routeless test helpers</summary>
The routeless integration test helpers such as .GETAsync<>() would throw an exception when testing an endpoint configured with the root URL /, which has now been fixed.
</details>
<details><summary>Query/Route param culture mismatch with routeless test helpers and backend</summary>
The routeless test helpers such as .GETAsync<>() would construct route/query params (of certain primitives such as DateTime) using the culture of the machine where the tests are being run, while the application is set up to use a different culture, the tests would fail. This has been solved by constructing route/query params for primitive/IFormattable types using ISO compliant invariant culture format when constructing the requests.
</details>
<details><summary>Routeless testing helpers contention issue</summary>
The test helpers were using a regular dictionary to cache test URLs internally which could sometimes cause trouble under high load. This has been solved by switching to a concurrent dictionary.
</details>
<details><summary>Source generators having trouble with special characters in project names</summary>
The source generators were generating incorrect namespaces if the project name has dashes such as My-Project.csproj which would result in generating namespaces with dashes, which is invalid for C#.
</details>
<details><summary>Test collection ordering regression</summary>
Due to an internal behavior change in XUnit v3, test collection ordering was being overriden by XUnit. This has been rectified by taking matters in to our own hands and bypassing XUnit's collection runner.
</details>
<details><summary>Job Queues storage processing</summary>
Several optimizations have been done to the job queues storage logic to reduce the number of queries in certain scenarios. Please see the breaking changes section below as one of the methods of IJobStorageProvider needs a minor change.
</details>
<details><summary>Easy access to error response content with testing helpers</summary>
You can now easily inspect why a request failed when you expected it to succeed. There's now a new string property ErrorContent on the TestResult record that routeless testing helpers return.
[Fact]
public async Task Get_Request_Responds_With_200_Ok()
{
var (rsp, res, errorContent) = await app.Client.GETAsync<MyEndpoint, MyRequest, string>(new() { ... });
if (rsp.IsSuccessStatusCode)
Assert.True(...);
else
Assert.Fail(errorContent); //errorContent contains the error response body as a string
}
</details>
<details><summary>Request DTO serialization behavior of testing helpers</summary>
Testing helpers such as .POSTAsync<>() will only serialize the request DTO in to the request body if there's at least one property on the DTO that will be bound from the JSON body. In instances where nothing should be bound from the JSON body, the request body content will be empty.
</details>
<details><summary>Mitigate incorrect service scoping due to user error in Command Bus</summary>
If a user for whatever reason registerd command handlers as scoped services in DI themselves (when they're not supposed to), it could lead to unexpected behavior. This is no longer an issue.
</details>
<details><summary>New 'IJobStorageProvider.DistributedJobProcessingEnabled' property</summary>
Due to adding support for distributed job processing, all storage provider implementations must now implement the following boolean property. Simply set it to false when not using distributed job processing like so:
sealed class JobStorageProvider : IJobStorageProvider<JobRecord>
{
public bool DistributedJobProcessingEnabled => false;
}
</details>
<details><summary>New 'IJobStorageRecord.DequeueAfter' property</summary>
Even though you only need to implement this property when using distributed job processing, it's recommended to either let all the jobs in your database run to completion before upgrading to v8.0 and/or run a migration to set the value of DequeueAfter to DateTime.MinValue for all jobs already in the database to ensure that they get picked up properly for processing. (Even when not using distributed processing.)
</details>
<details><summary>'IJobStorageProvider.GetNextBatchAsync()' return type change</summary>
As a result of optimizations done to the storage processing logic in job queues, your job storage provider implementation requires a minor change from:
public Task<IEnumerable<...>> GetNextBatchAsync(...)
to:
public Task<ICollection<...>> GetNextBatchAsync(...)
You are now required to return a materialized collection instead of an IEnumerable<T>.
</details>
Nothing published for this version
[//]: # (## Breaking Changes ⚠️)
Due to low financial backing by the community, FastEndpoints will soon be going into "Bugfix Only" mode until the situation improves. Please join the discussion here and help out if you can.
<details><summary>Standalone package for Event/Command Bus functionality</summary>
The in-process Event Bus and Command Bus features have been liberated from the clutches of the FastEndpoints main library. A new, independent FastEndpoints.Messaging package has been created. This package can be used in any .NET 8+ application, even with Blazor WASM. Simply install the nuget package and register it with the IOC container like so:
builder.Services.AddMessaging();
var host = builder.Build();
host.Services.UseMessaging();
There's no setup (nor code changes) needed for projects using FastEndpoints main library. The above is only for when you want to use the messaging functionality in projects that don't have FastEndpoints.
</details>
<details><summary>Standalone package for Job Queues functionality</summary>
The job queuing functionality has also been extracted out to a separate package FastEndpoints.JobQueues which can be used independently of the main FE library. No code changes are needed for existing FE projects.
</details>
<details><summary>Aspire Testing support for routeless test helpers</summary>
You can now use the routeless test helpers such as .GETAsync<MyEndpoint>() with Aspire DistributedApplication testing like so:
[Fact]
public async Task Endpoint_Returns_Ok_Response()
{
// Arrange
var ct = TestContext.Current.CancellationToken;
var appHost = await DistributedApplicationTestingBuilder.CreateAsync<Projects.AspireApp_AppHost>(ct);
await using var app = await appHost.BuildAsync(ct).WaitAsync(_defaultTimeout, ct);
await app.StartAsync(ct).WaitAsync(_defaultTimeout, ct);
await app.ResourceNotifications.WaitForResourceHealthyAsync("apiservice", ct).WaitAsync(_defaultTimeout, ct);
// Act
var httpClient = app.CreateHttpClient("apiservice");
var (response, _) = await httpClient.GETAsync<HelloEndpoint, EmptyResponse>();
// Assert
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
}
</details>
<details><summary>'FastEndpoints.HealthChecks' package</summary>
An opt-in library that eliminates boilerplate health check wiring for apps running behind orchestrators such as Kubernetes/.NET Aspire. You can now use the following convenient extension method and it's overloads:
// Defaults:
// - /health/live (liveness)
// - /health/ready (readiness)
builder.Services.AddServiceHealthChecks();
// Custom paths
builder.Services.AddServiceHealthChecks(
configureOptions: opts =>
{
opts.LivePath = "/alive";
opts.ReadyPath = "/ready";
});
// Add custom health checks
builder.Services.AddServiceHealthChecks(
configureChecks: hc =>
{
hc.AddNpgSql(connectionString, name: "postgres");
hc.AddRedis("localhost:6379", name: "redis");
});
Liveness returns 200 if process is alive (no dependency checks). Readiness runs all registered health checks and returns aggregate status with optional JSON response.
</details>
<details><summary>Test/verify command executions in endpoints without mocks/fakes</summary>
In a similar fashion to the previously released Test Event Receivers feature, you can now use Test Command Receivers to verify that a certain command execution was initiated by an endpoint or service without having to register fake command handlers.
Typically, you'd unit test the command/handlers in isolation to verify the business logic in those handlers and use the "Test Event/Command Receivers" to validate that certain entrypoints in your application actually do trigger/issue particular commands and events.
</details>
<details><summary>Strong-Name-Signed Assemblies</summary>
All FastEndpoints assemblies are now strong-name-signed. This only matters if your project is utilizing assembly signing. Signed projects will no longer show warnings about FastEndpoints not being signed.
</details>
<details><summary>Increased frequency of stream flushing in SSE</summary>
SSE streams are now flushed after each write as opposed to after every batch. This eliminates random pauses on the client-side due to stream buffering.
</details>
<details><summary>Job storage performance optimization</summary>
Optimized the JobQueue startup initialization by reusing the results of the existing scheduled-jobs query to determine whether the queue is in use, allowing the system to skip the additional query for future scheduled jobs when current jobs are already present, thereby reducing database load and improving startup performance without changing observable behavior.
</details>
<details><summary>Group summary overriding endpoint level summary data</summary>
There was an oversight that resulted in endpoint level summary data being overwritten by group level summary data in situations such as the following:
sealed class MyGroup : Group
{
public MyGroup()
{
Configure("group", ep => ep.Summary(s => s.Description = "group level text"));
}
}
sealed class MyEndpoint : EndpointWithoutRequest
{
public override void Configure()
{
Get("/something");
Group<MyGroup>();
Summary(s => s.Description = "endpoint level text"); //this would get loss due to the bug
}
}
</details>
<details><summary>Routeless test helpers and optional query params issue</summary>
Given a request DTO class such as:
public class MyRequest
{
[RouteParam]
public string? Something
}
When you don't supply a value for Something during testing with the routeless test helpers such as .GETAsync<>(), and empty query parameter would be appended to the request URL like so:
/my/endpoint?Something=
While this isn't inherently wrong, the common behavior in most REST clients, is to not send in a query parameter at all for when the value is empty. The test helpers will also follow suit from now on.
</details>
<details><summary>Request binder exception when request DTO ctor has a optional struct argument</summary>
The default request binder was throwing an exception when a request DTO has an optional constructor argument that is a struct type like the following.
sealed class MyRequest(SomeStruct someOptionalStruct = default)
{
...
}
</details>
[//]: # (## Breaking Changes ⚠️)
We've had .NET 10 preview support for a while and this is just a patch release to update the SDK references to .NET 10 final.
[//]: # (## Breaking Changes ⚠️)
Due to the current unfortunate state of FOSS, please consider becoming a sponsor and help us beat the odds to keep the project alive and free for everyone.
<details><summary>Better conditional sending of responses</summary>
All Send.*Async() methods now return a Task<Void> result. If a response needs to be sent conditionally, you can simply change the return type of the handler from Task to Task<Void> and return the awaited result as shown below in order to stop further execution of endpoint handler logic:
public override async Task<Void> HandleAsync(CancellationToken c)
{
if (id == 0)
return await Send.NotFoundAsync();
if (id == 1)
return await Send.NoContentAsync();
return await Send.OkAsync();
}
If there's no async work being done in the handler, the Task<Void> can simply be returned as well:
public override Task<Void> HandleAsync(CancellationToken c)
{
return Send.OkAsync();
}
</details>
<details><summary>Specify max request body size per endpoint</summary>
Instead of globally increasing the max request body size in Kestrel, you can now set a max body size per endpoint where necessary like so:
public override void Configure()
{
Post("/file-upload");
AllowFileUploads();
MaxRequestBodySize(50 * 1024 * 1024);
}
</details>
<details><summary>Customize error response builder func when using 'ProblemDetails'</summary>
You can now specify a custom response builder function when doing .UseProblemDetails() as shown below in case you have a special requirement to use a certain shape
for one or more of your endpoints while the rest of the endpoints use the standard response.
app.UseFastEndpoints(
c => c.Errors.UseProblemDetails(
p =>
{
p.ResponseBuilder = (failures, ctx, statusCode) =>
{
if (ctx.Request.Path.StartsWithSegments("/group-name"))
{
// return any shape you want to be serialized
return new
{
Errors = failures
};
}
// anything else will use the standard problem details.
return new ProblemDetails(failures, ctx.Request.Path, ctx.TraceIdentifier, statusCode);
};
}))
</details>
<details><summary>Use 'ProblemDetails.Detail' property for describing single error instances</summary>
The FastEndpoints.ProblemDetails.Detail property has been unused until now. It will now by default be populated according to the following DetailTransformer logic, which you can customize if needed. The transformer can also be set to null in case you'd like to go back to the previous behavior.
app.UseFastEndpoints(
c => c.Errors.UseProblemDetails(
p =>
{
p.DetailTransformer = pd => pd.Errors.Count() == 1
? pd.Errors.First().Reason
: null;
}))
The default behavior is to populate the Detail property with the reason if there's only 1 error and not populate it at all in case there's more than 1 error.
</details>
<details><summary>Specify a request binder per group</summary>
It is now possible to register a particular open generic request binder such as the following:
class MyBinder<TRequest> : RequestBinder<TRequest> where TRequest : notnull
{
public override async ValueTask<TRequest> BindAsync(BinderContext ctx, CancellationToken ct)
{
var req = await base.BindAsync(ctx, ct); // run the default binding logic
if (req is MyRequest r)
r.SomeValue = Guid.NewGuid().ToString(); // do whatever you like
return req;
}
}
only for a certain group configuration, so that only endpoints of that group will have the above custom binder associated with them.
sealed class MyGroup : Group
{
public MyGroup()
{
Configure("/my-group", ep => ep.RequestBinder(typeof(MyBinder<>)));
}
}
</details>
<details><summary>Position endpoint version anywhere in the route</summary>
With the built-in versioning, you could only have the endpoint version number either pre-fixed or post-fixed. You can now make the version appear anywhere in the route by using a route template. The template segment will be replaced by the actual version number instead of being prepended or appended.
sealed class MyEndpoint : EndpointWithoutRequest
{
public override void Configure()
{
Get("/sales/{_version_}/my-endpoint");
Version(1);
}
...
}
This version placement strategy must be enabled at startup like so:
app.UseFastEndpoints(
c =>
{
c.Versioning.RouteTemplate = "{_version_}";
})
If this setting is enabled, it will take precedence over the default behavior of appending/prepending the version number to the route.
</details>
<details><summary>Support for Feature Management libraries</summary>
Endpoints can now be setup to execute a FeatureFlag for every Http request that comes in, which allows an endpoint to be conditionally available according to some evaluation logic.
To create a feature flag, implement the interface IFeatureFlag and simply return true from the IsEnabledAsync() handler method if the endpoint is to be accessible to that particular request.
sealed class BetaTestersOnly : IFeatureFlag
{
public async Task<bool> IsEnabledAsync(IEndpoint endpoint)
{
//use whatever mechanism/library you like to determine if this endpoint is enabled for the current request.
if (endpoint.HttpContext.Request.Headers.TryGetValue("x-beta-tester", out _))
return true; // return true to enable
//this is optional. if you don't send anything, a 404 is sent automatically.
await endpoint.HttpContext.Response.SendErrorsAsync([new("featureDisabled", "You are not a beta tester!")]);
return false; // return false to disable
}
}
Attach it to the endpoint like so:
sealed class BetaEndpoint : EndpointWithoutRequest<string>
{
public override void Configure()
{
Get("beta");
FeatureFlag<BetaTestersOnly>();
}
public override async Task HandleAsync(CancellationToken c)
{
await Send.OkAsync("this is the beta!");
}
}
</details>
<details><summary>[FromCookie] attribute for auto binding cookie values</summary>
You can now decorate request DTO properties with [FromCookie] and matching cookies will be auto bound from incoming request cookies.
</details>
<details><summary>Recursive validation of Data Annotation Attributes</summary>
Until now, only the top level properties of a request DTO was being validated when using Data Annotation Attributes. This release adds support for recursively validating the whole object graph and generating errors for each that fails validation.
</details>
<details><summary>SSE response standard compliance</summary>
The SSE response implementation has been enhanced by making the Id property in StreamItem optional, adding an optional Retry property for client-side reconnection control, as well as introducing an extra StreamItem constructor overload for more flexibility. Additionally, the X-Accel-Buffering: no response header is now automatically sent to improve compatibility with reverse proxies like NGINX, ensuring streamed data is delivered without buffering. You can now do the following when doing multi-type data responses:
yield return new StreamItem("my-event", myData, 3000);
</details>
<details><summary>Respect app shutdown when using SSE</summary>
The SSE implementation now passes the ApplicationStopping cancellation token to your IAsyncEnumerable method. This means that streaming is cancelled at least when the application host is shutting down, and also when a user provided CancellationToken (if provided) triggers it.
public override async Task HandleAsync(CancellationToken ct)
{
await Send.EventStreamAsync(GetMultiDataStream(ct), ct);
async IAsyncEnumerable<StreamItem> GetMultiDataStream([EnumeratorCancellation] CancellationToken ct)
{
// Here ct is now your user provided CancellationToken combined with the ApplicationStopping CancellationToken.
while (!ct.IsCancellationRequested)
{
await Task.Delay(1000, ct);
yield return new StreamItem(Guid.NewGuid(), "your-event-type", 42);
}
}
}
</details>
<details><summary>Async variation of Global Response Modifier</summary>
If you need to do some async work in the global response modifier, you can now use the GlobalResponseModifierAsync variant.
</details>
<details><summary>Allow 'ValidationContext' instances to be cached</summary>
Until now, you were meant to obtain an instance of the validation context via ValidationContext.Instance in the method itself. Starting this release, you are now able to obtain it either in the constructor or property initializers and cache it for later use.
</details>
<details><summary>Incorrect enum value for JWT security algorithm was used</summary>
The wrong variant (SecurityAlgorithms.HmacSha256Signature) was being used for creating symmetric JWTs by default.
The default value has been changed to SecurityAlgorithms.HmacSha256. It's recommended to invalidate and regenerate new tokens if you've been using the default.
If for some reason, you'd like to keep using SecurityAlgorithms.HmacSha256Signature, you can set it yourself like so:
var token = JwtBearer.CreateToken(
o =>
{
o.SigningKey = ...;
o.SigningAlgorithm = SecurityAlgorithms.HmacSha256Signature;
});
</details>
<details><summary>Integration testing extensions ignoring custom header names</summary>
The testing httpclient extensions were ignoring user supplied custom header names such as the following:
[FromHeader("x-something")]
during the constructing of the http request message. It was instead using the DTO property name completely dismissing the custom header names.
</details>
<details><summary>Integration test extensions causing 404 if grouped endpoint configured with empty string</summary>
The test helper methods were constructing the url/route of the endpoint being tested incorrectly if that endpoint belonged to a group and was configured with an empty route like so:
sealed class MyGroup : Group
{
public MyGroup()
{
Configure("my-group", ep => ep.AllowAnonymous());
}
}
sealed class Request
{
[QueryParam]
public string Id { get; set; }
}
sealed class RootEndpoint : Endpoint<Request, string>
{
public override void Configure()
{
Get(string.Empty);
Group<MyGroup>();
}
...
}
</details>
<details><summary>Swagger generation failing when DTO inherits a virtual base property</summary>
When a base class has a virtual property that a derived class was overriding as shown below, Swagger generator was throwing an exception due an internal dictionary key duplication.
public abstract class BaseDto
{
public virtual string Name { get; set; }
}
sealed class DerivedClass : BaseDto
{
public override string Name { get; set; }
}
</details>
<details><summary>Jobs scheduled for the future not executed after app restart</summary>
If a job was scheduled for the future, it would not get picked up for execution in case the app was restarted. It would only get executed upon queuing a new job. It has now been fixed by probing the storage provider once at startup to check if there's any jobs scheduled for the future.
</details>
This is obviously is a wide-reaching breaking change which can be easily remedied with a quick regex based find & replace. Please see the breaking cha…
Due to the current unfortunate state of FOSS, please consider becoming a sponsor and help us beat the odds to keep the project alive and free for everyone.
<details><summary>Relocate response sending methods ⚠️</summary>
Response sending methods such as SendOkAsync() have been ripped out of the endpoint base class for a better intellisense experience and extensibility.
Going forward, the response sending methods are accessed via the Send property of the endpoint as follows:
public override async Task HandleAsync(CancellationToken c)
{
await Send.OkAsync("hello world!");
}
In order to add your own custom response sending methods, simply target the IResponseSender interface and write extension methods like so:
static class SendExtensions
{
public static Task HelloResponse(this IResponseSender sender)
=> sender.HttpContext.Response.SendOkAsync("hello!");
}
This is obviously is a wide-reaching breaking change which can be easily remedied with a quick regex based find & replace. Please see the breaking changes section below for step-by-step instructions on how to migrate. Takes less than a minute.
</details>
<details><summary>Send multiple Server-Sent-Event models in a single stream</summary>
It is now possible to send different types of data in a single SSE stream with the use of a wrapper type called StreamItem like so:
public override async Task HandleAsync(CancellationToken ct)
{
await Send.EventStreamAsync(GetMultiDataStream(ct), ct);
async IAsyncEnumerable<StreamItem> GetMultiDataStream([EnumeratorCancellation] CancellationToken ct)
{
long id = 0;
while (!ct.IsCancellationRequested)
{
await Task.Delay(1000, ct);
id++;
if (DateTime.Now.Second % 2 == 1)
yield return new StreamItem(id.ToString(), "odd-second", Guid.NewGuid()); //guide data
else
yield return new StreamItem(id.ToString(), "even-second", "hello!"); //string data
}
}
}
By default, the StreamItem will be serialized as a JSON object, but you can change this by inheriting from it and overriding the GetDataString method to return a different format such as XML or plain text.
</details>
<details><summary>Customize param names for strongly typed route params</summary>
It is now possible to customize the route param names when using the strongly typed route params feature by simply decorating the target DTO property with a [BindFrom("customName"))] attribute. If a BindFrom attribute annotation is not present on the property, the actual name of the property itself will end up being the route param name.
</details>
<details><summary>Support for malformed JSON array string binding</summary>
When submitting requests via SwaggerUI where a complex object collection is to be bound to a collection property of a DTO, SwaggerUI sends in a malformed string of JSON objects without properly enclosing them in the JSON array notation [...] such as the following:
{"something":"one"},{"something":"two"}
whereas it should be a proper JSON array such as this:
[{"something":"one"},{"something":"two"}]
Since we have no control over how SwaggerUI behaves, support has been added to the default request binder to support parsing and binding the malformed comma separateed JSON objects that SwaggerUI sends at the expense of a minor performance hit.
</details>
<details><summary>Auto infer query parameters for routeless integration tests</summary>
If you annotate request DTO properties with [RouteParam] attribute, the helper extensions such as .GETAsync() will now automatically populate
the request query string with values from the supplied DTO instance when sending integration test requests.
sealed class MyRequest
{
[RouteParam]
public string FirstName { get; set; }
public string LastName { get; set; }
}
[Fact]
public async Task Query_Param_Test()
{
var request = new MyRequest
{
FirstName = "John", //will turn into a query parameter
LastName = "Gallow" //will be in json body content
};
var result = await App.Client.GETAsync<MyEndpoint, MyRequest, string>(request);
}
</details>
<!-- ## Improvements 🚀 -->
<details><summary>Header example value not picked up from swagger example request</summary>
If a request DTO specifies a custom header name that is different from the property name such as the following:
sealed class GetItemRequest
{
[FromHeader("x-correlation-id")]
public Guid CorrelationId { get; init; }
}
and a summary example request is provided such as the following:
Summary(s => s.ExampleRequest = new GetItemRequest()
{
CorrelationId = "54321"
});
the example value from the summary example property was not being picked up due to an oversight.
</details>
<details><summary>Xml comments not picked up by swagger for request schema</summary>
There was a regression in the code path that was picking up Summary xml comments from DTO properties in certain scenarios, which has now been fixed.
</details>
<details><summary>Incorrect swagger example generation when '[FromBody] or [FromForm]' was used</summary>
If a request DTO was defined like this:
sealed class MyRequest
{
[FromBody]
public Something Body { get; set; }
}
and an example request is provided via the Summary like this:
Summary(x=>x.ExampleRequest = new MyRequest()
{
Body = new Something()
{
...
}
});
swagger generated the incorrect request example value which included the property name, which it shouldn't have.
</details>
<details><summary>Default exception handler setting incorrect mime type</summary>
Due to an oversight, the default exception handler was not correctly setting the intended content-type value of application/problem+json. Instead, it was being overwritten with application/json due to not using the correct overload of WriteAsJsonAsync() method internally.
</details>
<details><summary>API change of endpoint response sending methods</summary>
The response sending methods are no longer located on the endpoint class itself and are now accessed via the Send property of the endpoint.
This is a breaking change which you can easily fix by doing a quick find+replace using a text editor such as VSCode. Please follow the following steps in order to update your files:
Edit > Replace In Files and enable Regex Matching(?<!\.)\bSend(?=[A-Z][A-Za-z]*Async\b) as the regex to find matches to target for editing.Send. in the replacement field and hit Replace All(?<!\.)\bSendAsync\b as the regex.Send.OkAsync as the replacement and hit Replace All again.Note: In case some Send.OkAsync() calls won't compile, it's most likely you were using the SendAsync() overload that allowed to set a custom status code. Simply use the Send.ResponseAsync() method instead of Send.OkAsync() for those calls as OkAsync() doesn't allow custom status codes.
Here's a complete walkthrough of the above process.
</details>
<details><summary>Small change in the Server-Sent-Event response stream</summary>
Previously the Server-Sent-Event response was written as:
id:12345
event: my-event
data: hello world!
Notice the inconsistency in the spacing between the id, event and data fields. This has now been fixed to be consistent with the following format:
id: 12345
event: my-event
data: hello world!
</details>
Nothing published for this version
Due to the current unfortunate state of FOSS, please consider becoming a sponsor and help us beat the odds to keep the project alive and free for ever
Due to the current unfortunate state of FOSS, please consider becoming a sponsor and help us beat the odds to keep the project alive and free for everyone.
<!-- <details><summary>title text</summary></details> -->
<details><summary>Support 'Scope' based access restriction</summary>
Your can now restrict access based on Scopes in tokens (e.g., from OAuth2/OpenID Connect IDPs). Simply specify required scopes using the newly added Scopes() method:
public override void Configure()
{
Get("/item");
Scopes("item:read", "item:write");
}
This allows access if the user's "scope" claim includes ANY of the listed values. To require ALL scopes, use ScopesAll() instead.
By default, scopes are read from the "scope" claim, which can be changed like so:
app.UseFastEndpoints(c => c.Security.ScopeClaimType = "scp")
If scope values aren't space-separated, customize parsing like so:
app.UseFastEndpoints(c => c.Security.ScopeParser = input =>
{
//extract scope values and return a collection of strings
})
</details>
<details><summary>Automatic 'Accepts Metadata' for Non-Json requests</summary>
In the past, if an endpoint defines a request DTO type, an accepts-metadata of application/json would be automatically added to the endpoint, which would require the user to clear that default metadata if all the properties of the DTO is bound from non-json binding sources such as route/query/header etc.
Now, if the user annotates all the properties of a DTO with the respective non-json binding sources such as the following:
sealed class GetAccountStatementRequest
{
[RouteParam]
public int UserId { get; set; }
[QueryParam]
public DateTime DateFrom { get; set; }
[QueryParam]
public DateTime DateTo { get; set; }
}
It is no longer necessary for the user to manually clear the default accepts-metadata as the presence of non-json binding source attributes on each of the DTO properties allows us to correctly detect that there's not going to be any JSON body present in the incoming request.
</details>
<details><summary>Support for 'DataAnnotations' Validation Attributes</summary>
You can now annotate request DTO properties with DataAnnotations attributes such as [Required], [StringLength(...)] etc., instead of writing a FluentValidations validator for quick-n-dirty input validation. Do note however, only one of the strategies can be used for a single endpoint. I.e. if a request DTO has annotations as well as a fluent validator, only the fluent validator will be run and the annotations will be ignored. Mixing strategies is not allowed in order to prevent confusion for the reader. To enable DataAnnotations support, do the following:
app.UseFastEndpoints(c => c.Validation.EnableDataAnnotationsSupport = true)
</details>
<!-- ## Improvements 🚀 -->
<details><summary>Swagger generation bug caused by lists of request DTOs</summary>
A new feature introduced in v6.1 caused swagger generation to fail if the request DTO type of the endpoint is a List<T>, which has been corrected.
</details>
<details><summary>Infinite recursion issue with swagger generation due to self referencing validators</summary>
If a request uses a self referencing validator for nested properties, a stack overflow was happening due to infinite recursion.
</details>
<details><summary>Issue with generic post-processor registration</summary>
Generic post-processors were not being correctly registered due to an oversight, which has been corrected with this release.
</details>
<details><summary>Behavior change with multiple binding sources and the 'required' keyword</summary>
If a request DTO has required properties like so:
{
public required string UserId { get; set; } //to be bound from route param
public required string Name { get; set; } //to be bound from json body
}
The previous advice was to simply decorate the UserId property with a [JsonIgnore] attribute so that the serializer will ignore the required keyword and won't complain due to missing data for that property in the incoming JSON body.
Even though the [JsonIgnore] attribute seemed logical for this purpose at the time, we've come to realize it has the potential to cause problems elsewhere.
So, if you are using the required keyword on DTO properties that are to be bound from a non-json binding source such as route/query params, form fields, headers, claims, etc. and would like to keep on using the required keyword (even though it doesn't really make much sense in the context of request DTOs in most cases), you should remove the [JsonIgnore] property and annotate the binding related attribute that actually specifies what binding source should be used for that property, such as [RouteParam], [QueryParam], [FormField], [FromClaim], [FromHeader], etc.
The request DTO now needs to look like the following:
sealed class MyRequest
{
[RouteParam]
public required string UserId { get; set; }
public required string Name { get; set; }
}
</details>
[//]: # (## Breaking Changes ⚠️)
Due to the current unfortunate state of FOSS, please consider becoming a sponsor and help us beat the odds to keep the project alive and free for everyone.
<!-- <details><summary>title text</summary></details> -->
<details><summary>Convenience method for retrieving the auto generated endpoint name</summary>
You can now obtain the generated endpoint name like below for the purpose of custom link generation using the LinkGenerator class.
var endpointName = IEndpoint.GetName<SomeEndpoint>();
</details>
<details><summary>Auto population of headers in routeless tests</summary>
Given a request dto such as the following where a property is decorated with the [FromHeader] attribute:
sealed class Request
{
[FromHeader]
public string Title { get; set; }
public string FirstName { get; set; }
public string LastName { get; set; }
}
Previously, you had to manually add the header to the request in order for the endpoint to succeed without sending back an error response. Now you can simply supply the value for the header when making the request as follows, and the header will be automatically added to the request with the value from the property.
var (rsp, res) = await App.Client.POSTAsync<MyEndpoint, Request, string>(
new()
{
Title = "Mrs.",
FirstName = "Doubt",
LastName = "Fire"
});
This automatic behavior can be disabled as follows if you'd like to keep the previous behavior:
POSTAsync<...>(..., populateHeaders: false);
</details>
<details><summary>Comma separated value binding support for collection properties</summary>
It was only possible to model bind collection properties if the values were submitted either as json arrays or duplicate keys. You can now submit csv data for automatically binding to collection properties such as the following:
public class FindRequest
{
[QueryParam]
public string[] Status { get; set; }
}
A url with query parameters such as this would work out-of-the-box now:
/find?status=queued,completed
</details>
<details><summary>'SendAcceptedAtAsync()' method for endpoints</summary>
The following method is now available for sending a 202 - Accepted similarly to the 201 - Created response.
await SendAcceptedAtAsync<ProgressEndpoint>(new { Id = "123" });
</details>
<details><summary>Error Code & Error Severity support for the 'ThrowError()' method</summary>
A new overload has been added for the ThrowError() method where you can supply an error code and an optional severity value as follows:
ThrowError("Account is locked out!", errorCode: "AccountLocked", severity: Severity.Error, statusCode: 423);
</details>
<details><summary>Setting for changing 'default value' binding behavior</summary>
Given a request dto such as the following, which has a nullable value type property:
public class MyRequest
{
[QueryParam]
public int? Age { get; set; }
}
and a request is made with an empty parameter value such as:
/person?age=
the default behavior is to populate the property with the default value for that value type when model binding, and if the parameter name is also omitted, the property would end up being null.
You can now change this behavior so that in case an empty parameter is submitted, the property would end up being null, instead of the default value:
app.UseFastEndpoints(c => c.Binding.UseDefaultValuesForNullableProps = false)
Note: the setting applies to all non-STJ binding paths such as route/query/claims/headers/form fields etc.
</details>
<details><summary>Preliminery support for OData</summary>
A new pre-release package FastEndpoints.OData has been created to provide support for OData. Since the OData library's Minimal APIs support is still in flux, FE's OData package is referncing a nightly build from MyGet and the public API may change drastically. See here if you'd like to give it a try.
</details>
<details><summary>'Configuration Groups' support for refresh token service</summary>
Configuration groups were not previously compatible with the built-in refresh token functionality. You can now group refresh token service endpoints using a group as follows:
public class AuthGroup : Group
{
public AuthGroup()
{
Configure("users/auth", ep => ep.Options(x => x.Produces(401)));
}
}
public class UserTokenService : RefreshTokenService<TokenRequest, TokenResponse>
{
public MyTokenService(IConfiguration config)
{
Setup(
o =>
{
o.Endpoint("refresh-token", ep =>
{
ep.Summary(s => s.Summary = "this is the refresh token endpoint");
ep.Group<AuthGroup>(); // this was not possible before
});
});
}
}
</details>
<details><summary>Pick up Swagger request param example values from summary example</summary>
In the past, the only way to provide an example value for a swagger request parameter was with an xml document comment like so:
sealed class MyRequest
{
/// <example>john doe</example>
public string Name { get; set; }
}
The example values will now be picked up from the summary example request properties which you can supply like so:
Summary(
s => s.ExampleRequest = new()
{
Name = "jane doe"
});
If you provide both, the values from the summary example will take precedence.
</details>
<details><summary>Reflection source generator issue with 'required' properties</summary>
If a DTO class had required properties with [JsonIgnore] attributes such as this:
sealed class UpdateRequest
{
[JsonIgnore]
public required int Id { get; set; }
public required string Name { get; set; }
}
The reflection source generator failed to generate the correct object initialization factory causing a compile error, which has now been corrected.
</details>
<details><summary>'ClearDefaultProduces()' stopped working from global configurator</summary>
If ClearDefaultProduces() was called from the global endpoint configurator function, it had no effect due to a regression introduced in v6.0, which has now been corrected.
</details>
<details><summary>Incorrect OAS3 spec generation when 'NotNull()' or 'NotEmpty()' validators were used on nested objects</summary>
If a request DTO has complex nested properties and those properties are being validated with either NotNull() or NotEmpty(), an incorrect swagger3 spec was being generated due to a bug in the "validation schema processor".
</details>
Due to the current unfortunate state of FOSS, please consider becoming a sponsor and help us beat the odds to keep the project alive and free for ever
Due to the current unfortunate state of FOSS, please consider becoming a sponsor and help us beat the odds to keep the project alive and free for everyone.
<!-- <details><summary>title text</summary></details> -->
Support for .NET 6 & 7 has been dropped as those SDKs are no longer supported by Microsoft. In order to use this release of FastEndpoints, you need to be on at least .NET 8.0.4
<details><summary>Support for .NET 10 preview</summary>
You can start targeting net10.0 SDK in your FE projects now. Currently preview versions of the dependencies are used.
</details>
<details><summary>Generic Pre/Post Processor global registration</summary>
Open generic pre/post processors can now be registered globally using the endpoint configurator func like so:
app.UseFastEndpoints(c => c.Endpoints.Configurator = ep => ep.PreProcessors(Order.Before, typeof(MyPreProcessor<>)))
sealed class MyPreProcessor<TRequest> : IPreProcessor<TRequest>
{
public Task PreProcessAsync(IPreProcessorContext<TRequest> ctx, CancellationToken c)
{
...
}
}
</details>
<details><summary>Middleware pipeline for Command Bus</summary>
By popular demand from people moving away from MediatR, a middleware pipeline similar to MediatRs pipeline behaviors has been added to FE's built-in command bus. You just need to write your pipeline/middleware pieces by implementing the interface ICommandMiddleware<TCommand,TResult> and register those pieces to form a middleware pipeline as described in the documentation.
</details>
<details><summary>Support 'CONNECT' and 'TRACE' verbs</summary>
The FastEndpoints.Http enum and the endpoint base classes now have support for the HTTP CONNECT & TRACE verbs.
</details>
<details><summary>Verify event publishes when integration testing</summary>
When integration testing using the AppFixture, it is now possible to setup a Test Event Receiver as a collector of all the events that gets published from your code. These received events can be used as verification that your code did actually publish the desired event. A full example of this new capability can be seen here.
</details>
<details><summary>Dynamic updating of JWT signing keys at runtime</summary>
Updating the signing keys used by JWT middleware at runtime is now made simple without having to restart the application. See here for a full example of how it is done.
</details>
<details><summary>Automatic addition of 'ProducesResponseTypeMetadata'</summary>
The library automatically adds response type metadata for certain response types. Sometimes, the automatically added responses need to be cleared by the user when it's not appropriate. From now on, the automatic additions will only happen if the user hasn't already added it.
Before:
Description(x => x.ClearDefaultProduces(200) //had to clear the auto added 200
.Produces(201))
Now:
Description(x => x.Produces(201)) //nothing to clear as nothing was added due to 201 being present
</details>
<details><summary>Use source generated regex</summary>
Source generated regex is now used whereever possible. Source generated regex was not used before due to having to support older SDK versions.
</details>
<details><summary>Allow overriding the 'Verbs()' method of Endpoint<> class</summary>
The Verbs() method was sealed until now because it was doing some essential setup which was required for adding the default request/response swagger descriptions.
This logic has been moved out of the Verbs() method making it overrideable if needed.
</details>
<details><summary>Prevent configuration methods being called after startup</summary>
A meaningful exception will now be thrown if the user tries to call endpoint configuration methods such as Verbs()/Routes()/etc. outside of the endpoint Configure() method.
</details>
<details><summary>Contention issue in reflection source generator</summary>
The reflection source generator was using some static state which was causing issues in certain usage scenarios, which has now been fixed.
</details>
<details><summary>Type discriminator missing from polymorphic responses</summary>
The type discriminator was not being serialized by STJ when the response type was a base type, due to an oversight in the default response serialized func.
</details>
<details><summary>Source generated reflection for obsolete members</summary>
When source generation happens for obsolete members of classes, the generated file triggered a compiler warning, which has now been correctly handled.
</details>
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Due to the current unfortunate state of FOSS, please consider becoming a sponsor and help us beat the odds to keep the project alive and free for ever
Due to the current unfortunate state of FOSS, please consider becoming a sponsor and help us beat the odds to keep the project alive and free for everyone.
<!-- <details><summary>title text</summary></details> -->
<details><summary>Bypass endpoint caching for integration tests</summary>
You can now easily test endpoints that have caching enabled, by using a client configured to automatically bypass caching like so:
var antiCacheClient = App.CreateClient(new() { BypassCaching = true });
</details>
<details><summary>Mark properties as "bind required"</summary>
You can now make the request binder automatically add a validation failure when binding from route params, query params, and form fields by decorating the dto properties if the binding source doesn't provide a value:
sealed class MyRequest
{
[QueryParam(IsRequired = true)]
public bool Correct { get; set; }
[RouteParam(IsRequired = true)]
public int Count { get; set; }
[FormField(IsRequired = true)]
public Guid Id { get; set; }
}
</details>
<details><summary>Generic command support for job queues</summary>
Closed generic commands can now be registered like so:
app.Services.RegisterGenericCommand<QueueCommand<OrderCreatedEvent>, QueueCommandHandler<OrderCreatedEvent>>();
and then be queued as jobs like so:
await new QueueEventCommand<OrderCreatedEvent>()
{
...
}.QueueJobAsync();
Note: Open generic commands are not supported for job queueing.
</details>
<details><summary>Inter-Process-Communication via Unix-Domain-Sockets</summary>
The FastEndpoints.Messaging.Remote library can now do inter-process-communication via unix sockets when everything is running on the same machine by doing the following:
//server setup
bld.WebHost.ConfigureKestrel(k => k.ListenInterProcess("ORDERS_MICRO_SERVICE"));
//client setup
app.MapRemote("ORDERS_MICRO_SERVICE", c => c.Register<CreateOrderCommand>());
When a service is lifted out to a remote machine, all that needs to be done is to update the connection settings like so:
//server
bld.WebHost.ConfigureKestrel(k => k.ListenAnyIP(80, o => o.Protocols = HttpProtocols.Http2);
//client
app.MapRemote("http://orders.my-app.com", c => c.Register<CreateOrderCommand>());
</details>
<details><summary>Optionally save command type on job storage record</summary>
A new optional/addon interface IHasCommandType has been introduced if you need to persist the full type name of the command that is associated with the job storage record. Simply implement the new interface on your job storage record and the system will automatically populate the property value before being persisted.
</details>
<details><summary>RPC Event Subscriber parallel execution</summary>
Event subscribers used to execute the event handlers in sequence when a batch of event storage records were fetched from the storage provider. The handlers will now be executed in parallel just like how parallel execution happens in job queues.
</details>
<details><summary>RPC Event Hub startup sequence</summary>
The rpc event hub was using a thread sleep pattern during startup to restore subscriber IDs via the storage provider, resulting in a sequential initialization. It has been refactored to use an IHostedService together with retry logic for a proper async and parallel initialization, resulting in decreased startup time.
</details>
<details><summary>RPC Event Hub event distribution</summary>
Previously if a hub was not registered before events were broadcasted, or if event serialization fails due to user error, those exceptions would have been swallowed in some cases. The internals of the hub has been refactored to surface those exceptions when appropriate.
</details>
<details><summary>Workaround for NSwag quirk with byte array responses</summary>
NSwag has a quirk that it will render an incorrect schema if the user does something like the following:
b => b.Produces<byte[]>(200, "image/png");
In order to get the correct schema generated, we've had to do the following:
b => b.Produces<IFormFile>(200, "image/png");
You now have the ability to do either of the above, and it will generate the correct schema.
</details>
<details><summary>Job result is null when job execution failure occurs</summary>
The result property of job records that was passed into the OnHandlerExecutionFailureAsync() method of the storage provider was null due to an oversight, which has been corrected.
</details>
<details><summary>Parallel 'VersionSet' creation issue</summary>
If VersionSets are created by multiple SUTs at the same time when doing integration testing, a non-concurrent dictionary modification exception was being thrown.
The internal dictionary used to keep track of the version sets has been changed to a concurrent dictionary which solves the issue.
</details>
<details><summary>'IEventHubStorageProvider' contract change</summary>
In order to improve database write performance, the IEventHubStorageProvider.StoreEventAsync(TStorageRecord r, CancellationToken ct) method signature has been changed to the following:
ValueTask StoreEventsAsync(IEnumerable<TStorageRecord> r, CancellationToken ct);
Previously, records were persisted one at a time. Now, the records are supplied in batches allowing you to take advantage of batched inserts and/or transactions improving database write performance and consistency.
NOTE: You should make sure either none or all of the supplied records are persisted to disk in order to avoid duplicate events being published due to the built-in retry mechanism.
</details>
<details><summary>'IEvent.Broadcast()' extension method is no longer cancellable</summary>
The BroadCast() method is now a fire-n-forget method and no longer accepts a CancellationToken, which simplifies event publication.
</details>
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
<!-- ## Breaking Changes ⚠️ -->
Due to the current unfortunate state of FOSS, please consider becoming a sponsor and help us beat the odds to keep the project alive and free for everyone.
<!-- <details><summary>title text</summary></details> -->
<details><summary>Queued job progress tracking</summary>
It is now possible to queue a job and track its progress and/or retrieve intermediate results while the command handler executes via the job tracker as documented here.
</details>
<details><summary>Global 'JwtCreationOptions' support for refresh token service</summary>
If you configure jwt creation options at a global level like so:
bld.Services.Configure<JwtCreationOptions>( o => o.SigningKey = "..." );
The RefreshTokenService will now take the default values from the global config if you don't specify anything when configuring the token service like below:
sealed class MyTokenService : RefreshTokenService<TokenRequest, TokenResponse>
{
public MyTokenService
{
Setup(o =>
{
//no need to specify token signing key/style/etc. here unless you want to.
o.Endpoint("/api/refresh-token");
o.AccessTokenValidity = TimeSpan.FromMinutes(5);
o.RefreshTokenValidity = TimeSpan.FromHours(4);
});
}
}
</details>
<details><summary>Global response modifier setting</summary>
A new global action has been added which gets triggered right before a response is written to the response stream allowing you to carry out some common logic that should be applied to all endpoints.
app.UseFastEndpoints(
c => c.Endpoints.GlobalResponseModifier
= (ctx, content) =>
{
ctx.Response.Headers.Append("x-common-header", "some value");
})
</details>
<details><summary>Access 'IServiceProvider' when configuring Swagger Documents</summary>
You can now access the built service provider instance via the DocumentOptions.Services property when configuring swagger documents like so:
var bld = WebApplication.CreateBuilder(args);
bld.Services.Configure<MySettings>(bld.Configuration.GetSection(nameof(MySettings)));
bld.Services
.SwaggerDocument(
o =>
{
// IServiceProvider is available via DocumentOptions.Services property
var conf = o.Services.GetRequiredService<IOptions<MySettings>>();
o.DocumentSettings = doc =>
{
doc.DocumentName = conf.Value.DocName;
};
})
.AddFastEndpoints();
</details>
<details><summary>Value parser support for Reflection Source Generator</summary>
Value parser functions (used by non-stj model binding) will now be source generated instead of being compiled at runtime when you opt-in to use the reflection source generator.
</details>
<details><summary>Optimize value parser internals</summary>
String value parsing logic used in most non-stj model binding paths has been simplified and optimized to reduce allocations and unnecessary boxing.
</details>
<details><summary>Graceful shutdown of Job Queue processing</summary>
If app shutdown is requested during a retry loop (due to transient failures) in job queue processing, the operation will now be tried at least once before exiting the retry loops and allowing the app to shut down.
</details>
<details><summary>Miscellaneous improvements</summary>
FluentAssertions from FE test projects & documentation examplesSummary(x => {}) overload over the untyped overload in .NET 9</details>
<details><summary>Issue with unit testing endpoints with pre-processors with injected dependencies</summary>
Unit tests were failing to instantiate pre-processors that had injected dependencies due to a small oversight in the ServiceResolver code with regards to how singletons were instantiated, which has been fixed.
</details>
<details><summary>Potential infinite recursion in Swagger Processor due to circular references</summary>
In certain edge cases where the schema has circular references, there was a potential inifinite recursion issue which could lead to memory leaks when generating the swagger docs.
</details>
<!-- ## Breaking Changes ⚠️ -->
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
…deprecated classes as mentioned in the "Breaking Changes" section below.
Due to the current unfortunate state of FOSS, please consider becoming a sponsor and help us beat the odds to keep the project alive and free for everyone.
<!-- <details><summary>title text</summary></details> -->
<details><summary>Migrate to xUnit v3 ⚠️</summary>
If you're using the FastEndpoints.Testing package in your test projects, take the following steps to migrate your projects:
.csproj file:
xunit v2 package.xunit.v3 library with version 1.0.0xunit.runner.visualstudio to 3.0.0AppFixture<TProgram> classes, such as SetupAsync and TearDownAsync. Change their return type from Task to ValueTask to resolve these errors.XUnit.Abstractions namespace not being found, simply delete those "using statements" as that namespace has been removed in xUnit v3.After doing the above, it should pretty much be smooth sailing, unless your project is affected by the removal of previously deprecated classes as mentioned in the "Breaking Changes" section below.
</details>
<details><summary>Eliminate the need for [BindFrom(...)] attribute</summary>
Until now, when binding from sources other than JSON body, you had to annotate request DTO properties with the [BindFrom("my_field")] attribute when the incoming field name is different to the DTO property name. A new setting has now been introduced which allows you to use the same property naming policy as the serializer for matching incoming request parameters without having to use any attributes.
app.UseFastEndpoints(c => c.Binding.UsePropertyNamingPolicy = true)
This only applies to properties where you haven't specified the field names manually using an attribute such as [BindFrom(...)], [FromClaim(...)]. [FromHeader(...)] etc.
</details>
<details><summary>Control binding sources per DTO property</summary>
The default binding order is designed to minimize attribute clutter on DTO models. In most cases, disabling binding sources is unnecessary. However, for rare scenarios where a binding source must be explicitly blocked, you can now do the following:
[DontBind(Source.QueryParam | Source.RouteParam)]
public string UserID { get; set; }
The opposite approach can be taken as well, by just specifying a single binding source for a property like so:
[FormField]
public string UserID { get; set; }
[QueryParam]
public string UserName { get; set; }
[RouteParam]
public string InvoiceID { get; set; }
</details>
<details><summary>Deeply nested complex model binding from query parameters</summary>
Binding deeply nested complex DTOs from incoming query parameters is now supported. Please refer to the documentation here.
</details>
<details><summary>Swagger descriptions for deeply nested DTO properties</summary>
Until now, if you wanted to provide text descriptions for deeply nested request DTO properties, the only option was to provide them via XML document summary tags. You can now provide descriptions for deeply nested properties like so:
Summary(
s =>
{
s.RequestParam(r => r.Nested.Name, "nested name description");
s.RequestParam(r => r.Nested.Items[0].Id, "nested item id description");
});
Descriptions for lists and arrays can be provided by using an index 0 to get at the actual property. Note: only lists and arrays can be used for this.
</details>
<!-- ## Improvements 🚀 -->
<details><summary>Incorrect latest version detection with 'Release Versioning' strategy</summary>
The new release versioning strategy was not correctly detecting the latest version of an endpoint if there was multiple endpoints for the same route such as a GET & DELETE endpoint on the same route.
</details>
<details><summary>Issue with nullability context not being thread safe in Swagger processor</summary>
In rare occasions where swagger documents were being generated concurrently, an exception was being thrown due to NullabilityInfoContext not being thread safe. This has been fixed by implementing a caching mechanism per property type.
</details>
<details><summary>Complex DTO handling in routeless testing extensions</summary>
If the request DTO is a complex structure, testing with routeless test extensions like the following did not work correctly:
[Fact]
public async Task FormDataTest()
{
var book = new Book
{
BarCodes = [1, 2, 3],
CoAuthors = [new Author { Name = "a1" }, new Author { Name = "a2" }],
MainAuthor = new() { Name = "main" }
};
var (rsp, res) = await App.GuestClient.PUTAsync<MyEndpoint, Book, Book>(book, sendAsFormData: true);
rsp.IsSuccessStatusCode.Should().BeTrue();
res.Should().BeEquivalentTo(book);
}
</details>
<details><summary>Incorrect detection of generic arguments of generic commands</summary>
There was a minor oversight in correctly detecting the number of generic arguments of generic commands if there was more than one. This has been fixed to correctly detect all generic arguments of generic commands.
</details>
<details><summary>Complex form data binding issue</summary>
When binding deeply nested form data with the [FromForm] attribute, if a certain deeply nested objects didn't have at least one primitive type property, it would not get bound correctly. This has been fixed as well as the binding logic being improved.
</details>
<details><summary>Removal of deprecated classes (Testing related)</summary>
After following the xUnit v3 upgrade instructions above, you may be affected by the removal of the following previously deprecated classes:
TestFixture<TProgram>: Use the AppFixture<TProgram> class instead.TestClass<TFixture>: Use the TestBase<TFixture> class instead.</details>
<details><summary>Removal of constructor overloads from 'AppFixture<TProgram>'</summary>
Due to the migration to xUnit v3, the AppFixture<TProgram> base class no longer accepts IMessageSink and ITestOutputHelper arguments and only has a parameterless constructor.
</details>
<details><summary>Removal of undocumented [FromQueryParams] attribute</summary>
[FromQueryParams] was an undocumented feature that was put in place to help people migrating from old MVC projects to make the transition easier. It was not documented due to its extremely poor performance and we wanted to discourage people from using query parameters as a means to submit complex data structures.
The newly introduced [FromQuery] attribute can be used now if you really must send complex query parameters. However, it is not a one-to-one replacement as the query naming convention is quite strict and simplified.
</details>
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
One column per quarter.