diff --git a/src/Radarr.Api.V3/ProviderControllerBase.cs b/src/Radarr.Api.V3/ProviderControllerBase.cs index f432a8274..d5405f0b1 100644 --- a/src/Radarr.Api.V3/ProviderControllerBase.cs +++ b/src/Radarr.Api.V3/ProviderControllerBase.cs @@ -48,6 +48,7 @@ protected override TProviderResource GetResourceById(int id) } [HttpGet] + [Produces("application/json")] public List GetAll() { var providerDefinitions = _providerFactory.All(); @@ -165,6 +166,7 @@ private TProviderDefinition GetDefinition(TProviderResource providerResource, TP public object DeleteProvider(int id) { _providerFactory.Delete(id); + return new { }; } @@ -178,6 +180,7 @@ public virtual object DeleteProviders([FromBody] TBulkProviderResource resource) } [HttpGet("schema")] + [Produces("application/json")] public List GetTemplates() { var defaultDefinitions = _providerFactory.GetDefaultDefinitions().OrderBy(p => p.ImplementationName).ToList(); @@ -201,6 +204,7 @@ public List GetTemplates() [SkipValidation(true, false)] [HttpPost("test")] + [Consumes("application/json")] public object Test([FromBody] TProviderResource providerResource) { var existingDefinition = providerResource.Id > 0 ? _providerFactory.Find(providerResource.Id) : null; @@ -222,12 +226,15 @@ public IActionResult TestAll() foreach (var definition in providerDefinitions) { - var validationResult = _providerFactory.Test(definition); + var validationFailures = new List(); + + validationFailures.AddRange(definition.Settings.Validate().Errors); + validationFailures.AddRange(_providerFactory.Test(definition).Errors); result.Add(new ProviderTestAllResult { Id = definition.Id, - ValidationFailures = validationResult.Errors.ToList() + ValidationFailures = validationFailures }); }