From 2e4e07a20744086320e1b444e93ed324c71a2027 Mon Sep 17 00:00:00 2001 From: Timothy Date: Mon, 13 Jul 2026 00:38:29 +0200 Subject: [PATCH] =?UTF-8?q?fix(#172):=20review=20B1=20=E2=80=94=20sync=204?= =?UTF-8?q?04=20metadata=20test=20+=20extend=20create-group=20trim=20to=20?= =?UTF-8?q?Deco/DecoTemplate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cold review (PR #325) caught that removing the unreachable 404 from BlockController/TemplateController.CreateGroup left ApiErrorResponseMetadataTests still asserting those ops document 404 -> red Build & test. Removed those two stale assertions. For spec consistency, extended the trim to the two OTHER create-group actions carrying the same unreachable 404 (DecoController, DecoTemplateController -- their Create*GroupHandler only do a duplicate-name AnyAsync -> 422, never a lookup that 404s). Net: all four CreateGroup 404 assertions removed (422 siblings kept), both controllers trimmed, v1.json regenerated (4 unreachable 404 blocks gone total). PlaylistController.CreateGroup already carried no 404. Refs #172 Co-Authored-By: Claude Opus 4.8 (1M context) --- .../ApiErrorResponseMetadataTests.cs | 4 -- ErsatzTV/Controllers/Api/DecoController.cs | 1 - .../Controllers/Api/DecoTemplateController.cs | 1 - ErsatzTV/wwwroot/openapi/v1.json | 40 ------------------- 4 files changed, 46 deletions(-) diff --git a/ErsatzTV.Tests/Controllers/ApiErrorResponseMetadataTests.cs b/ErsatzTV.Tests/Controllers/ApiErrorResponseMetadataTests.cs index 9b42119e5..1354cf192 100644 --- a/ErsatzTV.Tests/Controllers/ApiErrorResponseMetadataTests.cs +++ b/ErsatzTV.Tests/Controllers/ApiErrorResponseMetadataTests.cs @@ -70,7 +70,6 @@ public class ApiErrorResponseMetadataTests [TestCase(typeof(ScheduleController), nameof(ScheduleController.DeleteItem), StatusCodes.Status404NotFound)] [TestCase(typeof(ScheduleController), nameof(ScheduleController.DeleteItem), StatusCodes.Status422UnprocessableEntity)] [TestCase(typeof(BlockController), nameof(BlockController.GetById), StatusCodes.Status404NotFound)] - [TestCase(typeof(BlockController), nameof(BlockController.CreateGroup), StatusCodes.Status404NotFound)] [TestCase(typeof(BlockController), nameof(BlockController.CreateGroup), StatusCodes.Status422UnprocessableEntity)] [TestCase(typeof(BlockController), nameof(BlockController.DeleteGroup), StatusCodes.Status404NotFound)] [TestCase(typeof(BlockController), nameof(BlockController.Create), StatusCodes.Status404NotFound)] @@ -83,7 +82,6 @@ public class ApiErrorResponseMetadataTests [TestCase(typeof(BlockController), nameof(BlockController.Copy), StatusCodes.Status404NotFound)] [TestCase(typeof(BlockController), nameof(BlockController.Copy), StatusCodes.Status422UnprocessableEntity)] [TestCase(typeof(TemplateController), nameof(TemplateController.GetById), StatusCodes.Status404NotFound)] - [TestCase(typeof(TemplateController), nameof(TemplateController.CreateGroup), StatusCodes.Status404NotFound)] [TestCase(typeof(TemplateController), nameof(TemplateController.CreateGroup), StatusCodes.Status422UnprocessableEntity)] [TestCase(typeof(TemplateController), nameof(TemplateController.DeleteGroup), StatusCodes.Status404NotFound)] [TestCase(typeof(TemplateController), nameof(TemplateController.Create), StatusCodes.Status404NotFound)] @@ -95,7 +93,6 @@ public class ApiErrorResponseMetadataTests [TestCase(typeof(TemplateController), nameof(TemplateController.Copy), StatusCodes.Status404NotFound)] [TestCase(typeof(TemplateController), nameof(TemplateController.Copy), StatusCodes.Status422UnprocessableEntity)] [TestCase(typeof(DecoController), nameof(DecoController.GetById), StatusCodes.Status404NotFound)] - [TestCase(typeof(DecoController), nameof(DecoController.CreateGroup), StatusCodes.Status404NotFound)] [TestCase(typeof(DecoController), nameof(DecoController.CreateGroup), StatusCodes.Status422UnprocessableEntity)] [TestCase(typeof(DecoController), nameof(DecoController.DeleteGroup), StatusCodes.Status404NotFound)] [TestCase(typeof(DecoController), nameof(DecoController.Create), StatusCodes.Status404NotFound)] @@ -104,7 +101,6 @@ public class ApiErrorResponseMetadataTests [TestCase(typeof(DecoController), nameof(DecoController.Replace), StatusCodes.Status404NotFound)] [TestCase(typeof(DecoController), nameof(DecoController.Replace), StatusCodes.Status422UnprocessableEntity)] [TestCase(typeof(DecoTemplateController), nameof(DecoTemplateController.GetById), StatusCodes.Status404NotFound)] - [TestCase(typeof(DecoTemplateController), nameof(DecoTemplateController.CreateGroup), StatusCodes.Status404NotFound)] [TestCase(typeof(DecoTemplateController), nameof(DecoTemplateController.CreateGroup), StatusCodes.Status422UnprocessableEntity)] [TestCase(typeof(DecoTemplateController), nameof(DecoTemplateController.DeleteGroup), StatusCodes.Status404NotFound)] [TestCase(typeof(DecoTemplateController), nameof(DecoTemplateController.Create), StatusCodes.Status404NotFound)] diff --git a/ErsatzTV/Controllers/Api/DecoController.cs b/ErsatzTV/Controllers/Api/DecoController.cs index 40a5ebc54..ddd828589 100644 --- a/ErsatzTV/Controllers/Api/DecoController.cs +++ b/ErsatzTV/Controllers/Api/DecoController.cs @@ -29,7 +29,6 @@ public class DecoController(IMediator mediator) : ControllerBase [EndpointSummary("Create a deco group")] [EndpointGroupName("general")] [ProducesResponseType(typeof(DecoGroupResponseModel), StatusCodes.Status201Created)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status422UnprocessableEntity)] public async Task CreateGroup( [Required][FromBody] CreateDecoGroupRequest request, diff --git a/ErsatzTV/Controllers/Api/DecoTemplateController.cs b/ErsatzTV/Controllers/Api/DecoTemplateController.cs index 62dd15e67..fb89569f2 100644 --- a/ErsatzTV/Controllers/Api/DecoTemplateController.cs +++ b/ErsatzTV/Controllers/Api/DecoTemplateController.cs @@ -30,7 +30,6 @@ public class DecoTemplateController(IMediator mediator) : ControllerBase [EndpointSummary("Create a deco template group")] [EndpointGroupName("general")] [ProducesResponseType(typeof(DecoTemplateGroupResponseModel), StatusCodes.Status201Created)] - [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status404NotFound)] [ProducesResponseType(typeof(ProblemDetails), StatusCodes.Status422UnprocessableEntity)] public async Task CreateGroup( [Required][FromBody] CreateDecoTemplateGroupRequest request, diff --git a/ErsatzTV/wwwroot/openapi/v1.json b/ErsatzTV/wwwroot/openapi/v1.json index a4d7fab32..77ed5c7e7 100644 --- a/ErsatzTV/wwwroot/openapi/v1.json +++ b/ErsatzTV/wwwroot/openapi/v1.json @@ -4127,26 +4127,6 @@ } } }, - "404": { - "description": "Not Found", - "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, "422": { "description": "Unprocessable Entity", "content": { @@ -4819,26 +4799,6 @@ } } }, - "404": { - "description": "Not Found", - "content": { - "text/plain": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - }, - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - }, - "text/json": { - "schema": { - "$ref": "#/components/schemas/ProblemDetails" - } - } - } - }, "422": { "description": "Unprocessable Entity", "content": {