Releases: benmccallum/fairybread
v5.1.0
Performance/memory improvements
v5.0.0
Removes the AssembliesToScanForValidators
option as since 4.1.0 it was no longer necessary and it's usage now was confusing to describe (e.g. if supplied, you still need to register the validators with DI).
It's only remaining purpose was to "filter out" validators from non-included assemblies so FairyBread wouldn't use them in it's pipeline, but I doubt anyone was using it for that purpose and that wouldn't improve perf.
If anyone does want filtering, we could look to introduce that under a new option.
v4.1.1
v4.1.0
Simplifies setup.
Previously you needed to tell FairyBread about the assemblies to crawl for validators. Now it crawls the IServiceCollection
at startup.
Before:
// Add the FluentValidation validators
services.AddValidatorsFromAssemblyContaining<FooInputDtoValidator>();
// Add GraphQL and FairyBread
services
.AddGraphQL()
.AddFairyBread(options =>
{
options.AssembliesToScanForValidators = new[] { typeof(FooInputDtoValidator).Assembly };
});
Now:
// Add the FluentValidation validators
services.AddValidatorsFromAssemblyContaining<FooInputDtoValidator>();
// Add GraphQL and FairyBread
services
.AddGraphQL()
.AddFairyBread();
v4.0.0
This release changes the way validation errors are reported which results in a few breaking changes but gives us a lot more flexibility in the future.
Instead of collecting validation errors and then throwing an exception for an IErrorFilter
to report the error, the validation errors are now passed over to a IValidationErrorsHandler
(whose default implementation calls ReportError
on each validation failure) and the middleware short-circuits.
Breaking changes:
- Existing error filter removed.
- To customize errors reported still you can substitute in your own
IValidationErrorsHandler
(potentially inheriting the default implementation and just overriding theCreateErrorBuilder
, calling the base impl to create the default error and then the Set methods to customize some things).
- To customize errors reported still you can substitute in your own
- The structure of the errors sent back has changed.
- There's now (by default) an error item added per argument and per validation rule failure. If you want them grouped as before, you could do that also with a custom
IValidationErrorsHandler
and not loop over each like the default impl does.
- There's now (by default) an error item added per argument and per validation rule failure. If you want them grouped as before, you could do that also with a custom
IValidationErrorHandler
removed (it wasn't doing anything and is replaced byIValidationErrorsHandler
that does the error reporting; if anyone was using it, let me know and we can work out an alternative).
v3.0.1
Merge branch 'develop'
v3.0.0
Merge branch 'master' of https://github.com/benmccallum/fairybread
v2.0.0
2.0.0
v1.0.0
Merge branch 'develop'