From 0a05781aca1651abb18ac5474fc56d45b9df136a Mon Sep 17 00:00:00 2001 From: Bogdan Date: Tue, 30 May 2023 21:20:39 +0300 Subject: [PATCH] Remove not implemented endpoints from API docs --- src/Sonarr.Api.V3/Health/HealthController.cs | 6 + .../Indexers/ReleaseControllerBase.cs | 7 + .../LanguageProfileSchemaController.cs | 8 +- src/Sonarr.Api.V3/ProviderControllerBase.cs | 5 + src/Sonarr.Api.V3/Queue/QueueController.cs | 6 + .../Queue/QueueDetailsController.cs | 6 + .../Queue/QueueStatusController.cs | 6 + src/Sonarr.Api.V3/openapi.json | 358 ------------------ src/Sonarr.Http/REST/RestController.cs | 2 +- 9 files changed, 44 insertions(+), 360 deletions(-) diff --git a/src/Sonarr.Api.V3/Health/HealthController.cs b/src/Sonarr.Api.V3/Health/HealthController.cs index 4c6007f72..fe1fd954c 100644 --- a/src/Sonarr.Api.V3/Health/HealthController.cs +++ b/src/Sonarr.Api.V3/Health/HealthController.cs @@ -22,6 +22,12 @@ namespace Sonarr.Api.V3.Health _healthCheckService = healthCheckService; } + [NonAction] + public override ActionResult GetResourceByIdWithErrorHandler(int id) + { + return base.GetResourceByIdWithErrorHandler(id); + } + protected override HealthResource GetResourceById(int id) { throw new NotImplementedException(); diff --git a/src/Sonarr.Api.V3/Indexers/ReleaseControllerBase.cs b/src/Sonarr.Api.V3/Indexers/ReleaseControllerBase.cs index 8522c3ec7..e08475952 100644 --- a/src/Sonarr.Api.V3/Indexers/ReleaseControllerBase.cs +++ b/src/Sonarr.Api.V3/Indexers/ReleaseControllerBase.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; using NzbDrone.Core.DecisionEngine; using NzbDrone.Core.Profiles.Qualities; using Sonarr.Http.REST; @@ -15,6 +16,12 @@ namespace Sonarr.Api.V3.Indexers _qualityProfile = qualityProfileService.GetDefaultProfile(string.Empty); } + [NonAction] + public override ActionResult GetResourceByIdWithErrorHandler(int id) + { + return base.GetResourceByIdWithErrorHandler(id); + } + protected override ReleaseResource GetResourceById(int id) { throw new NotImplementedException(); diff --git a/src/Sonarr.Api.V3/Profiles/Languages/LanguageProfileSchemaController.cs b/src/Sonarr.Api.V3/Profiles/Languages/LanguageProfileSchemaController.cs index fd3e549cc..ad5a32704 100644 --- a/src/Sonarr.Api.V3/Profiles/Languages/LanguageProfileSchemaController.cs +++ b/src/Sonarr.Api.V3/Profiles/Languages/LanguageProfileSchemaController.cs @@ -32,9 +32,15 @@ namespace Sonarr.Api.V3.Profiles.Languages }; } + [NonAction] + public override ActionResult GetResourceByIdWithErrorHandler(int id) + { + return base.GetResourceByIdWithErrorHandler(id); + } + protected override LanguageProfileResource GetResourceById(int id) { - throw new global::System.NotImplementedException(); + throw new NotImplementedException(); } } } diff --git a/src/Sonarr.Api.V3/ProviderControllerBase.cs b/src/Sonarr.Api.V3/ProviderControllerBase.cs index b1e4524c5..2a64c0cb7 100644 --- a/src/Sonarr.Api.V3/ProviderControllerBase.cs +++ b/src/Sonarr.Api.V3/ProviderControllerBase.cs @@ -68,6 +68,7 @@ namespace Sonarr.Api.V3 [RestPostById] [Consumes("application/json")] + [Produces("application/json")] public ActionResult CreateProvider([FromBody] TProviderResource providerResource, [FromQuery] bool forceSave = false) { var providerDefinition = GetDefinition(providerResource, true, !forceSave, false); @@ -84,6 +85,7 @@ namespace Sonarr.Api.V3 [RestPutById] [Consumes("application/json")] + [Produces("application/json")] public ActionResult UpdateProvider([FromBody] TProviderResource providerResource, [FromQuery] bool forceSave = false) { var providerDefinition = GetDefinition(providerResource, true, !forceSave, false); @@ -101,6 +103,7 @@ namespace Sonarr.Api.V3 [HttpPut("bulk")] [Consumes("application/json")] + [Produces("application/json")] public ActionResult UpdateProvider([FromBody] TBulkProviderResource providerResource) { var definitionsToUpdate = _providerFactory.Get(providerResource.Ids).ToList(); @@ -198,6 +201,7 @@ namespace Sonarr.Api.V3 } [HttpPost("testall")] + [Produces("application/json")] public IActionResult TestAll() { var providerDefinitions = _providerFactory.All() @@ -225,6 +229,7 @@ namespace Sonarr.Api.V3 [SkipValidation] [HttpPost("action/{name}")] [Consumes("application/json")] + [Produces("application/json")] public IActionResult RequestAction(string name, [FromBody] TProviderResource resource) { var providerDefinition = GetDefinition(resource, false, false, false); diff --git a/src/Sonarr.Api.V3/Queue/QueueController.cs b/src/Sonarr.Api.V3/Queue/QueueController.cs index e3c2cb452..605bc9db9 100644 --- a/src/Sonarr.Api.V3/Queue/QueueController.cs +++ b/src/Sonarr.Api.V3/Queue/QueueController.cs @@ -58,6 +58,12 @@ namespace Sonarr.Api.V3.Queue _qualityComparer = new QualityModelComparer(qualityProfileService.GetDefaultProfile(string.Empty)); } + [NonAction] + public override ActionResult GetResourceByIdWithErrorHandler(int id) + { + return base.GetResourceByIdWithErrorHandler(id); + } + protected override QueueResource GetResourceById(int id) { throw new NotImplementedException(); diff --git a/src/Sonarr.Api.V3/Queue/QueueDetailsController.cs b/src/Sonarr.Api.V3/Queue/QueueDetailsController.cs index ed62a277e..b9c7cb9c2 100644 --- a/src/Sonarr.Api.V3/Queue/QueueDetailsController.cs +++ b/src/Sonarr.Api.V3/Queue/QueueDetailsController.cs @@ -26,6 +26,12 @@ namespace Sonarr.Api.V3.Queue _pendingReleaseService = pendingReleaseService; } + [NonAction] + public override ActionResult GetResourceByIdWithErrorHandler(int id) + { + return base.GetResourceByIdWithErrorHandler(id); + } + protected override QueueResource GetResourceById(int id) { throw new NotImplementedException(); diff --git a/src/Sonarr.Api.V3/Queue/QueueStatusController.cs b/src/Sonarr.Api.V3/Queue/QueueStatusController.cs index 39d04f1d3..db38634a6 100644 --- a/src/Sonarr.Api.V3/Queue/QueueStatusController.cs +++ b/src/Sonarr.Api.V3/Queue/QueueStatusController.cs @@ -30,6 +30,12 @@ namespace Sonarr.Api.V3.Queue _broadcastDebounce = new Debouncer(BroadcastChange, TimeSpan.FromSeconds(5)); } + [NonAction] + public override ActionResult GetResourceByIdWithErrorHandler(int id) + { + return base.GetResourceByIdWithErrorHandler(id); + } + protected override QueueStatusResource GetResourceById(int id) { throw new NotImplementedException(); diff --git a/src/Sonarr.Api.V3/openapi.json b/src/Sonarr.Api.V3/openapi.json index 940d297c8..2f2a33ddf 100644 --- a/src/Sonarr.Api.V3/openapi.json +++ b/src/Sonarr.Api.V3/openapi.json @@ -1401,20 +1401,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/DownloadClientResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/DownloadClientResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/DownloadClientResource" - } } } } @@ -1457,20 +1447,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/DownloadClientResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/DownloadClientResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/DownloadClientResource" - } } } } @@ -1544,20 +1524,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/DownloadClientResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/DownloadClientResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/DownloadClientResource" - } } } } @@ -2244,36 +2214,6 @@ } } }, - "/api/v3/health/{id}": { - "get": { - "tags": [ - "Health" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/HealthResource" - } - } - } - } - } - } - }, "/api/v3/history": { "get": { "tags": [ @@ -2613,20 +2553,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/ImportListResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/ImportListResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/ImportListResource" - } } } } @@ -2669,20 +2599,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/ImportListResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/ImportListResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/ImportListResource" - } } } } @@ -2756,20 +2676,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/ImportListResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/ImportListResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/ImportListResource" - } } } } @@ -3084,20 +2994,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/IndexerResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/IndexerResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/IndexerResource" - } } } } @@ -3140,20 +3040,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/IndexerResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/IndexerResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/IndexerResource" - } } } } @@ -3227,20 +3117,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/IndexerResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/IndexerResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/IndexerResource" - } } } } @@ -3686,36 +3566,6 @@ "deprecated": true } }, - "/api/v3/languageprofile/schema/{id}": { - "get": { - "tags": [ - "LanguageProfileSchema" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/LanguageProfileResource" - } - } - } - } - } - } - }, "/api/v3/localization": { "get": { "tags": [ @@ -4107,20 +3957,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/MetadataResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/MetadataResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/MetadataResource" - } } } } @@ -4163,20 +4003,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/MetadataResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/MetadataResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/MetadataResource" - } } } } @@ -4250,20 +4080,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/MetadataResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/MetadataResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/MetadataResource" - } } } } @@ -4748,20 +4568,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/NotificationResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/NotificationResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/NotificationResource" - } } } } @@ -4804,20 +4614,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/NotificationResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/NotificationResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/NotificationResource" - } } } } @@ -4891,20 +4691,10 @@ "200": { "description": "Success", "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/NotificationResource" - } - }, "application/json": { "schema": { "$ref": "#/components/schemas/NotificationResource" } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/NotificationResource" - } } } } @@ -5455,34 +5245,6 @@ "description": "Success" } } - }, - "get": { - "tags": [ - "Queue" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueueResource" - } - } - } - } - } } }, "/api/v3/queue/bulk": { @@ -5682,36 +5444,6 @@ } } }, - "/api/v3/queue/details/{id}": { - "get": { - "tags": [ - "QueueDetails" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueueResource" - } - } - } - } - } - } - }, "/api/v3/queue/status": { "get": { "tags": [ @@ -5731,36 +5463,6 @@ } } }, - "/api/v3/queue/status/{id}": { - "get": { - "tags": [ - "QueueStatus" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/QueueStatusResource" - } - } - } - } - } - } - }, "/api/v3/release": { "post": { "tags": [ @@ -5828,36 +5530,6 @@ } } }, - "/api/v3/release/{id}": { - "get": { - "tags": [ - "Release" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReleaseResource" - } - } - } - } - } - } - }, "/api/v3/releaseprofile": { "post": { "tags": [ @@ -6096,36 +5768,6 @@ } } }, - "/api/v3/release/push/{id}": { - "get": { - "tags": [ - "ReleasePush" - ], - "parameters": [ - { - "name": "id", - "in": "path", - "required": true, - "schema": { - "type": "integer", - "format": "int32" - } - } - ], - "responses": { - "200": { - "description": "Success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReleaseResource" - } - } - } - } - } - } - }, "/api/v3/remotepathmapping": { "post": { "tags": [ diff --git a/src/Sonarr.Http/REST/RestController.cs b/src/Sonarr.Http/REST/RestController.cs index db574bb50..7632d8b7f 100644 --- a/src/Sonarr.Http/REST/RestController.cs +++ b/src/Sonarr.Http/REST/RestController.cs @@ -48,7 +48,7 @@ namespace Sonarr.Http.REST [RestGetById] [Produces("application/json")] - public ActionResult GetResourceByIdWithErrorHandler(int id) + public virtual ActionResult GetResourceByIdWithErrorHandler(int id) { try {