Bump FastEndpoints and FastEndpoints.ApiExplorer #34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated FastEndpoints from 5.5.0 to 5.22.0.
Release notes
Sourced from FastEndpoints's releases.
5.22
✨ Looking For Sponsors ✨
FastEndpoints needs sponsorship to sustain the project. Please help out if you can.
New 🎉
Attribute driven response headers
Please see the documentation for more information.
Allow a Post-Processor to act as the sole mechanism for sending responses
As shown in this example, a post-processor can now be made the sole orchestrator of sending the
appropriate response such as in the case with the "Results Pattern".
Support for generic commands and command handlers
Please see the documentation for more information.
Improvements 🚀
Auto resolving of Mappers in unit tests
Previously it was necessary for the user to instantiate and set the mapper on endpoints when unit testing endpoints classes. It is no longer necessary to do so
unless you want to. Existing code doesn't need to change as the
Mapperproperty is still publicly settable.Respect default values of constructor arguments when model binding
The default request binder will now use the default values from the constructor arguments of the DTO when instantiating the DTO before model binding starts. For
example, the
SomeOtherParamproperty will have a value of10if no other binding sources provides a value for it.... (truncated)
5.21.2
✨ Looking For Sponsors ✨
FastEndpoints needs sponsorship to sustain the project. Please help out if you can.
Fixes 🪲
Configure()method #5695.21
✨ Looking For Sponsors ✨
FastEndpoints needs sponsorship to sustain the project. Please help out if you can.
New 🎉
Api Client generation using Kiota
Kiota is now the recommended way to generate API Clients. Please see the documentation on how
to use it. The previous methods for client generation using NSwag are still valid but may be deprecated at a future point in time.
Attribute based Pre/Post Processor configuration
When doing simple attribute based endpoint configuration instead of using the
Configure()method, you can now add pre/post processors to the endpoint like so:Ability to specify descriptions with ACL generation
You can now specify a description/xml doc summary for individual permission items when source generating them. See the documentation on how to use it.
[HideFromDocs] attribute for removing properties from Swagger schema
The .NET 8 Request Delegate Generator is not yet compatible with FastEndpoints as FE has it's own endpoint mapping and model binding system which will require a complete rewrite as a Source Generator to properly support Native AOT. We're currently investigating ways to achieve that but cannot give a timeframe on completion as it's a massive undertaking. You can see our internal discussion about this matter on discord.
Simpler way to register Pre/Post Processors with DI support
Processors can now be configured just by specifying the type of the processor without the need for instantiating them yourself.
While the old PreProcessors(...) method continues to work, the new method automatically resolves any constructor injected dependencies without you having to manually register the processors in DI.
Exception handling capability for Post-Processors
Post-Processors can now handle uncaught exceptions as an alternative to an exception handling middleware.
... (truncated)
5.19.2
Fixes 🪲
Tests couldn't assert on 'ProblemDetails' DTO due to having private property setters
Trying to assert on properties of
ProblemDetailswhen testing, STJ could not deserialize the error JSON response due to the DTO having incorrect access modifiers for public properties, which has been corrected with this patch release.5.19.1
Fixes 🪲
Auto binding collections of form files fails after first request
An object disposed error was being thrown in subsequent requests for file collection submissions due to a flaw in the model binding logic, which has now been corrected.
5.19
✨ Looking For Sponsors ✨
FastEndpoints needs sponsorship to sustain the project. Please help out if you can.
New 🎉
Model binding collections of 'IFormFile' from incoming form data
The following types of properties can now be automatically model bound from
fileform data fields.When submitting collections of form files, the incoming field names can be one of the following 3 formats:
Multiple request examples for Swagger
Multiple examples for the request DTO can be specified by either setting the
ExampleRequestproperty of the Summary class multiple times or adding tothe
RequestExamplescollection like so:... (truncated)
5.18
✨ Looking For Sponsors ✨
FastEndpoints needs sponsorship to sustain the project. Please help out if you can.
New 🎉
Source generated DI registrations
Please see the documentation for details of this feature.
Source generated access control lists
Please see the documentation for details of this feature.
Ability to show deprecated endpoint versions in Swagger
By default, deprecated endpoint versions are not included in swagger docs. Now you have the choice of including/displaying them in the doc so they'll be displayed greyed out like this:
Please see this usage example on how to enable it.
Round-Robin Event delivery with gRPC
It is now possible to deliver an event to only just one of the connected remote subscribers in a round-robin fashion. Comes in handy when you need to distribute the workload among a pool of subscribers/workers and ensure that a single event is only processed by a single remote subscriber. See the documentation for more info.
Improvements 🚀
Ability to get rid of null-forgiving operator '!' from test code
The
TestResult<TResponse>.Resultproperty is no longer a nullable property. This change enables us to get rid of the null-forgiving operator!from our integration test code.Existing test code wouldn't have to change. You just don't need to use the
!to hide the compiler warnings anymore. If/when the value of the property is actuallynull, the tests willjust fail with a NRE, which is fine in the context of test code.
5.17.1
✨ Looking For Sponsors ✨
FastEndpoints needs sponsorship to sustain the project. Please help out if you can.
🪲 Fixes
Auth policy not found bug
The auth policy builder was not being run when an endpoint only specifies a
Policies(...)config call.🚀 Improvements
Internal optimizations in 'FastEndpoints.Testing' package
TestFixturetype.5.17
✨ Looking For Sponsors ✨
FastEndpoints needs sponsorship to sustain the project. Please help out if you can.
🔖 New
'FastEndpoints.Testing' package for convenient Integration testing
Please see the documentation for details.
🪲 Fixes
Example generation for swagger nullable request params
Swagger schema example was being auto generated for request parameters even if the field (DTO property) is nullable. See bug report here. Which is not the desired behavior.
Now the examples are only auto generated if developer hasn't decorated the property with a XML example or
[DefaultValue(...)]attribute for nullable properties.Non-nullable properties will always get the example/default values filled in the following order:
[DefaultValue(...)]attribute > XML Comment > Auto generated exampleType discovery source generator behavior change
The source generator no longer automatically discovers types from referenced assemblies/projects.
You now have to add the
FastEndpoints.Generatorpackage to each project you'd like to use type discovery with and register the discovered types per assembly like so:5.16
✨ Looking For Sponsors ✨
FastEndpoints needs sponsorship to sustain the project. Please help out if you can.
🔖 New
Integration testing with fake/test handlers for messaging features
Both
In-ProcandRPCbased messaging functionality can now be easily integration tested by registering fake/test handlers during testing. See below links for examples of each:[DontRegister] attribute for skipping auto registration
Any auto discovered types (endpoints/commands/events/etc.) can be annotated with the attribute
[DontRegister]if you'd like it to be skipped while assembly scanning for auto registration.Auto instantiation of 'JsonSerializerContext' with global 'SerializerOptions'
By specifying just the type of the serializer context, instead of supplying an instance as with the existing method, the context will be created using the
SerializerOptionsthat you've configured at startup using theUseFastEndpoints(...)call.Auto generation of examples for swagger request parameters
Take the following example request DTO:
🚀 Improvements
Allow customization of in-memory event queue size
If you're are using the default in-memory event storage providers, the size limit of their internal queues can now be specified like so:
2️⃣ Reliable remote Pub/Sub event queues
Please refer to the documentation for details of this feature.
🪲 Fixes
1️⃣ Scope creation in a Validator was throwing an exception in unit tests
Validator code such as the following was preventing the validator from being unit tested via the
Factory.CreateValidator<T>()method, which has now been fixed.An example mapper that uses the
Resolve<T>()method would be such as this:3️⃣ Unit test Mapper & Validator classes that use Resolve<T>()
Mappers & Validators that use the
Resolve<T>()methods to obtain services from the DI container can now be unit tested by supplying the necessary dependencies.