You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.
NancyBootstrapperBase registers two IModelValidatorFactory instances when Nancy.Validation.FluentValidation NuGet package is being used. Having two factories causes the validation errors to appear twice.
This behavior is still here in v0.21.1.0, I'm using Autofac and Fluent. Needed to write a similar workaround:
protected override void RegisterTypes(ILifetimeScope container, IEnumerable<TypeRegistration> typeRegistrations)
{
base.RegisterTypes(container, typeRegistrations.Where(
// this factory is registered as TypeRegistration and CollectionTypeRegistration for some reason
// which results in validators being used twice each time, generating two error messages
// ignoring this component here solves the problem
x => x.ImplementationType != typeof(FluentValidationValidatorFactory))
);
}
NancyBootstrapperBase registers two IModelValidatorFactory instances when Nancy.Validation.FluentValidation NuGet package is being used. Having two factories causes the validation errors to appear twice.
Original description of this issue with code examples available here:
https://gist.github.com/mattilaj/24732c8353065f9bcfc5
A minimal reproducible is available for download here:
https://skydrive.live.com/redir?resid=D6C0FB440C48EDBB!530&authkey=!AKy9iTzYKff25DE
The text was updated successfully, but these errors were encountered: