mirror of
https://github.com/gwdevhub/Daybreak.git
synced 2026-07-24 20:12:20 +00:00
19 lines
523 B
C#
19 lines
523 B
C#
using Microsoft.AspNetCore.Routing.Constraints;
|
|
|
|
namespace Daybreak.API.Swagger;
|
|
|
|
public static class WebApplicationBuilderExtensions
|
|
{
|
|
public static WebApplicationBuilder WithSwagger(this WebApplicationBuilder builder)
|
|
{
|
|
builder.Services.AddEndpointsApiExplorer();
|
|
builder.Services.Configure<RouteOptions>(static options =>
|
|
{
|
|
options.SetParameterPolicy<RegexInlineRouteConstraint>("regex");
|
|
});
|
|
builder.Services.AddOpenApi();
|
|
|
|
return builder;
|
|
}
|
|
}
|