diff --git a/NDB.Extensions.Swagger/NDB.Extensions.Swagger.csproj b/NDB.Extensions.Swagger/NDB.Extensions.Swagger.csproj index c86e518..46ef9fb 100644 --- a/NDB.Extensions.Swagger/NDB.Extensions.Swagger.csproj +++ b/NDB.Extensions.Swagger/NDB.Extensions.Swagger.csproj @@ -8,11 +8,12 @@ https://dev.azure.com/tstanciu94/NDB Git NDB swagger + 1.0.1 - + diff --git a/NDB.Extensions.Swagger/SwaggerExtensions.cs b/NDB.Extensions.Swagger/SwaggerExtensions.cs index dd4ee3b..3b35ded 100644 --- a/NDB.Extensions.Swagger/SwaggerExtensions.cs +++ b/NDB.Extensions.Swagger/SwaggerExtensions.cs @@ -13,6 +13,17 @@ namespace NDB.Extensions.Swagger public static class SwaggerExtensions { public static IServiceCollection AddSwagger(this IServiceCollection services, string title, AuthorizationType authorizationType = AuthorizationType.Basic) + { + services.AddSwaggerGen(c => + { + c.SwaggerDoc("v1", new OpenApiInfo { Title = title, Version = "v1" }); + c.SetAuthorization(authorizationType); + }); + + return services; + } + + public static IServiceCollection AddSwaggerWithFilters(this IServiceCollection services, string title, AuthorizationType authorizationType = AuthorizationType.Basic) { services.AddSwaggerGen(c => {