Add descriptions for endpoints for use in openapi
This commit is contained in:
@@ -17,6 +17,7 @@ public static class CreateCar
|
||||
return builder
|
||||
.MapPost("cars", Endpoint)
|
||||
.WithTags("Cars")
|
||||
.WithDescription("Creates a new car")
|
||||
.Produces<Response>(201)
|
||||
.ProducesValidationProblem();
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ public static class DeleteCar
|
||||
return builder
|
||||
.MapDelete("cars/{id:guid}", Endpoint)
|
||||
.WithTags("Cars")
|
||||
.WithDescription("Deletes a car by ID")
|
||||
.Produces(204)
|
||||
.Produces(404);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ public static class UpdateCar
|
||||
return builder
|
||||
.MapPut("cars/{id:guid}", Endpoint)
|
||||
.WithTags("Cars")
|
||||
.WithDescription("Updates a car by ID")
|
||||
.Produces<Response>()
|
||||
.ProducesValidationProblem()
|
||||
.Produces(404);
|
||||
|
||||
@@ -17,6 +17,7 @@ public static class CreateConsumption
|
||||
return builder
|
||||
.MapPost("consumptions", Endpoint)
|
||||
.WithTags("Consumptions")
|
||||
.WithDescription("Creates a new consumption entry")
|
||||
.Produces<Response>(201);
|
||||
}
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ public static class DeleteConsumption
|
||||
return builder
|
||||
.MapDelete("consumptions/{id:guid}", Endpoint)
|
||||
.WithTags("Consumptions")
|
||||
.WithDescription("Deletes a consumption entry by ID")
|
||||
.Produces(204)
|
||||
.Produces(404);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ public static class GetConsumption
|
||||
return builder
|
||||
.MapGet("consumptions/{id:guid}", Endpoint)
|
||||
.WithTags("Consumptions")
|
||||
.WithDescription("Returns a single consumption entry by ID")
|
||||
.Produces<Response>()
|
||||
.Produces(404);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ public static class UpdateConsumption
|
||||
return builder
|
||||
.MapPut("consumptions/{id:guid}", Endpoint)
|
||||
.WithTags("Consumptions")
|
||||
.WithDescription("Updates a consumption entry by ID")
|
||||
.Produces<Response>()
|
||||
.ProducesValidationProblem()
|
||||
.Produces(404);
|
||||
|
||||
Reference in New Issue
Block a user