using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; using Scalar.AspNetCore; namespace Auth.API.Config; public static class Swagger { public static IServiceCollection AddSwagger(this IServiceCollection services) { services.AddOpenApi(options => { options.AddDocumentTransformer((document, context, cancellationToken) => { document.Info.Title = "Auth API"; document.Info.Version = "v1"; return Task.CompletedTask; }); }); return services; } public static IEndpointRouteBuilder UseSwag(this IEndpointRouteBuilder app) { app.MapScalarApiReference(); return app; } }