Enhance API endpoints with response type annotations
CI / Backend (build + test) (push) Successful in 1m15s
CI / Frontend (lint + typecheck + build) (push) Successful in 30s

- 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:
Leonid Pershin
2026-07-02 12:56:03 +03:00
parent 8067be3c35
commit 8b92204733
15 changed files with 493 additions and 143 deletions
@@ -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;
}