❇️ Help Keep FastEndpoints Free & Open-Source ❇️
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.
Breaking Changes ⚠️
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
New 🎉
Support for .NET 10 preview
You can start targeting net10.0 SDK in your FE projects now. Currently preview versions of the dependencies are used.
Generic Pre/Post Processor global registration
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)
{
...
}
}Middleware pipeline for Command Bus
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.
Support 'CONNECT' and 'TRACE' verbs
The FastEndpoints.Http enum and the endpoint base classes now have support for the HTTP CONNECT & TRACE verbs.
Verify event publishes when integration testing
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.
Dynamic updating of JWT signing keys at runtime
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.
Improvements 🚀
Automatic addition of 'ProducesResponseTypeMetadata'
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 presentUse source generated regex
Source generated regex is now used whereever possible. Source generated regex was not used before due to having to support older SDK versions.
Allow overriding the 'Verbs()' method of `Endpoint<>` class
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.
Prevent configuration methods being called after startup
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.
Fixes 🪲
Contention issue in reflection source generator
The reflection source generator was using some static state which was causing issues in certain usage scenarios, which has now been fixed.
Type discriminator missing from polymorphic responses
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.
Source generated reflection for obsolete members
When source generation happens for obsolete members of classes, the generated file triggered a compiler warning, which has now been correctly handled.