Files
2026-08-05 21:15:14 +03:00

29 lines
754 B
C#
Executable File

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;
}
}