Enhance API endpoints with response type annotations
- Updated various API endpoints to include response type annotations using .Produces<T>() for better documentation and type safety. - Enhanced activation, admin, user, config, and other endpoints to specify response types, improving clarity for frontend integration. - Added new DTOs for structured responses in authentication and Telegram-related endpoints. - Improved overall API schema generation to reflect these changes, ensuring consistency between backend and frontend types.
This commit is contained in:
@@ -12,7 +12,9 @@ public static class SubscriptionEndpoints
|
||||
// Вне /api по дизайну (api-design.md) — публичный эндпоинт для VPN-клиентов.
|
||||
app.MapGet("/sub/{token}", GetSubscription)
|
||||
.WithTags("Subscription")
|
||||
.RequireRateLimiting(RateLimiting.AuthPolicy);
|
||||
.RequireRateLimiting(RateLimiting.AuthPolicy)
|
||||
.Produces<string>(StatusCodes.Status200OK, "text/plain")
|
||||
.Produces(StatusCodes.Status404NotFound);
|
||||
|
||||
return app;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user