Enable API versioning with route group.
Fix: the API routing is now versioned with prefix `api/v1`, aligned to OpenAPI specifications.
This commit is contained in:
@ -11,9 +11,9 @@ public partial class UserJsonContext : JsonSerializerContext { }
|
||||
|
||||
public static class UserEndpoint
|
||||
{
|
||||
public static void Register(WebApplication app)
|
||||
public static void Register(RouteGroupBuilder parentGroup)
|
||||
{
|
||||
var group = app.MapGroup("/users");
|
||||
var group = parentGroup.MapGroup("/users");
|
||||
|
||||
group.MapGet("/", GetAllUsers);
|
||||
group.MapGet("/{id}", GetUserById);
|
||||
|
Reference in New Issue
Block a user