From a94c72861a23687d4f65239cfd9dcdd5cffc589d Mon Sep 17 00:00:00 2001 From: Fritiof Hedman Date: Sun, 7 Jun 2026 19:14:28 +0200 Subject: [PATCH] Mark endpoints for Swagger --- src/FrameProcessor/Controllers/FramesController.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/FrameProcessor/Controllers/FramesController.cs b/src/FrameProcessor/Controllers/FramesController.cs index 7fca916..2d12ad3 100644 --- a/src/FrameProcessor/Controllers/FramesController.cs +++ b/src/FrameProcessor/Controllers/FramesController.cs @@ -41,7 +41,11 @@ public sealed class FramesController : ControllerBase } [HttpPost("{name}/image")] - public async Task UploadImage(string name, CancellationToken cancellationToken) + [Consumes("multipart/form-data")] + public async Task UploadImage( + string name, + IFormFile image, + CancellationToken cancellationToken) { var stopwatch = Stopwatch.StartNew(); @@ -50,7 +54,7 @@ public sealed class FramesController : ControllerBase return NotFound(); } - var file = Request.Form.Files.GetFile("image"); + var file = image; if (file is null || file.Length == 0) { return BadRequest(new { error = "Missing 'image' file part." }); @@ -70,6 +74,7 @@ public sealed class FramesController : ControllerBase } [HttpPost("{name}/image-url")] + [Consumes("application/json")] public async Task UploadImageUrl( string name, [FromBody] ImageUrlRequest? body, @@ -149,5 +154,6 @@ public sealed class FramesController : ControllerBase }); } - public sealed record ImageUrlRequest(string? Url); } + +public sealed record ImageUrlRequest(string? Url);