diff --git a/NzbDrone.Api/Indexers/IndexerModule.cs b/NzbDrone.Api/Indexers/IndexerModule.cs index 0b5ffc052..fd19ea4a1 100644 --- a/NzbDrone.Api/Indexers/IndexerModule.cs +++ b/NzbDrone.Api/Indexers/IndexerModule.cs @@ -28,7 +28,7 @@ public IndexerModule(IIndexerService indexerService) SharedValidator.RuleFor(c => c.Name).NotEmpty(); SharedValidator.RuleFor(c => c.Implementation).NotEmpty(); - SharedValidator.RuleForField(c => c.Fields, "Url").NotEmpty(); + SharedValidator.RuleForField(c=>c.Fields,"Url").NotEmpty(); PostValidator.RuleFor(c => c.Fields).NotEmpty(); } diff --git a/NzbDrone.Api/REST/ResourceValidator.cs b/NzbDrone.Api/REST/ResourceValidator.cs index 556a6034b..a5c0e4268 100644 --- a/NzbDrone.Api/REST/ResourceValidator.cs +++ b/NzbDrone.Api/REST/ResourceValidator.cs @@ -3,6 +3,7 @@ using System.Linq.Expressions; using FluentValidation; using FluentValidation.Internal; +using FluentValidation.Resources; using NzbDrone.Api.ClientSchema; using System.Linq; @@ -10,10 +11,11 @@ namespace NzbDrone.Api.REST { public class ResourceValidator : AbstractValidator { - public IRuleBuilderInitial RuleForField(Expression>> fieldListAccessor, string filedName) + public IRuleBuilderInitial RuleForField(Expression>> fieldListAccessor, string fieldName) { - var rule = new PropertyRule(fieldListAccessor.GetMember(), c => GetValue(c, fieldListAccessor.Compile(), filedName), null, () => { return CascadeMode.Continue; }, typeof(TProperty), typeof(TResource)); - rule.PropertyName += "." + filedName; + var rule = new PropertyRule(fieldListAccessor.GetMember(), c => GetValue(c, fieldListAccessor.Compile(), fieldName), null, () => CascadeMode.Continue, typeof(TProperty), typeof(TResource)); + rule.PropertyName += "." + fieldName; + rule.DisplayName = new StaticStringSource(fieldName); AddRule(rule); return new RuleBuilder(rule);