Specify API returns types for swagger

This commit is contained in:
2025-06-16 20:28:37 +02:00
parent b989c43ec3
commit bcbf76fda6
10 changed files with 35 additions and 14 deletions

View File

@@ -1,4 +1,5 @@
using Vegasco.Server.Api.Persistence;
using Microsoft.AspNetCore.Http.HttpResults;
using Vegasco.Server.Api.Persistence;
namespace Vegasco.Server.Api.Cars;
@@ -10,7 +11,10 @@ public static class GetCar
{
return builder
.MapGet("cars/{id:guid}", Endpoint)
.WithTags("Cars");
.WithDescription("Returns a single car by ID")
.WithTags("Cars")
.Produces<Response>()
.Produces(404);
}
private static async Task<IResult> Endpoint(
@@ -28,4 +32,4 @@ public static class GetCar
var response = new Response(car.Id.Value, car.Name);
return TypedResults.Ok(response);
}
}
}