NDB.Extensions.Swagger updates
parent
552db38f16
commit
3e84ec9f01
|
@ -8,11 +8,12 @@
|
||||||
<RepositoryUrl>https://dev.azure.com/tstanciu94/NDB</RepositoryUrl>
|
<RepositoryUrl>https://dev.azure.com/tstanciu94/NDB</RepositoryUrl>
|
||||||
<RepositoryType>Git</RepositoryType>
|
<RepositoryType>Git</RepositoryType>
|
||||||
<PackageTags>NDB swagger</PackageTags>
|
<PackageTags>NDB swagger</PackageTags>
|
||||||
|
<Version>1.0.1</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="NDB.Application.DataContracts" Version="1.0.0" />
|
<PackageReference Include="NDB.Application.DataContracts" Version="1.0.0" />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.3.1" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|
|
@ -13,6 +13,17 @@ namespace NDB.Extensions.Swagger
|
||||||
public static class SwaggerExtensions
|
public static class SwaggerExtensions
|
||||||
{
|
{
|
||||||
public static IServiceCollection AddSwagger(this IServiceCollection services, string title, AuthorizationType authorizationType = AuthorizationType.Basic)
|
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 =>
|
services.AddSwaggerGen(c =>
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue