Specify API returns types for swagger
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user