mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 05:23:31 -07:00
Added support for schema field validation. no UI support.
This commit is contained in:
parent
8ad447a209
commit
576ea8560b
2 changed files with 34 additions and 1 deletions
|
@ -1,9 +1,11 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using FluentValidation.Internal;
|
||||
using NzbDrone.Api.ClientSchema;
|
||||
using NzbDrone.Api.Mapping;
|
||||
using NzbDrone.Api.REST;
|
||||
using NzbDrone.Api.Validation;
|
||||
using NzbDrone.Core.Indexers;
|
||||
using Omu.ValueInjecter;
|
||||
using FluentValidation;
|
||||
|
@ -26,6 +28,8 @@ namespace NzbDrone.Api.Indexers
|
|||
SharedValidator.RuleFor(c => c.Name).NotEmpty();
|
||||
SharedValidator.RuleFor(c => c.Implementation).NotEmpty();
|
||||
|
||||
SharedValidator.RuleForField<string>(c => c.Fields, "Url").NotEmpty();
|
||||
|
||||
PostValidator.RuleFor(c => c.Fields).NotEmpty();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue