Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Commit

Permalink
Updated swashbuckle
Browse files Browse the repository at this point in the history
  • Loading branch information
david-driscoll committed Jan 13, 2020
1 parent 543323c commit 09ee140
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions Packages.props
Expand Up @@ -25,6 +25,8 @@
<PackageReference Update="NodaTime" Version="2.4.7" />
<PackageReference Update="NodaTime.Serialization.JsonNet" Version="2.2.0" />
<PackageReference Update="NodaTime.Serialization.SystemTextJson" Version="1.0.0-beta01" />
<PackageReference Update="Rocket.Surgery.AspNetCore" Version="0.3.0-beta.115" />
<PackageReference Update="Rocket.Surgery.AspNetCore.NewtonsoftJson" Version="0.3.0-beta.115" />
<PackageReference Update="Rocket.Surgery.Conventions" Version="9.0.7" />
<PackageReference Update="Rocket.Surgery.Conventions" Version="9.0.7" />
<PackageReference Update="Rocket.Surgery.Conventions.Abstractions" Version="9.0.7" />
Expand Down
Expand Up @@ -6,8 +6,8 @@
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Rocket.Surgery.AspNetCore.NewtonsoftJson" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" />
<PackageReference Include="Rocket.Surgery.AspNetCore.FluentValidation.NewtonsoftJson" />
<PackageReference Include="NodaTime.Serialization.JsonNet" />
</ItemGroup>
</Project>
@@ -1,8 +1,12 @@
using System;
using JetBrains.Annotations;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Models;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Serialization;
using NodaTime;
using Rocket.Surgery.AspNetCore.Swashbuckle.NewtonsoftJson;
using Rocket.Surgery.Conventions;
using Rocket.Surgery.Extensions.DependencyInjection;
Expand Down Expand Up @@ -31,7 +35,7 @@ public void Register(IServiceConventionContext context)
{
throw new ArgumentNullException(nameof(context));
}

context.Services.AddSwaggerGenNewtonsoftSupport();
context.Services.Configure<SwaggerGenOptions>(
options =>
Expand Down
3 changes: 1 addition & 2 deletions src/Swashbuckle/Rocket.Surgery.AspNetCore.Swashbuckle.csproj
Expand Up @@ -6,14 +6,13 @@
</PropertyGroup>
<ItemGroup>
<FrameworkReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Rocket.Surgery.AspNetCore" />
<PackageReference Include="Swashbuckle.AspNetCore" />
<PackageReference Include="Swashbuckle.AspNetCore.ReDoc" />
<!-- <PackageReference Include="Swashbuckle.AspNetCore.Filters" />-->
<PackageReference Include="MicroElements.Swashbuckle.FluentValidation" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Rocket.Surgery.AspNetCore.FluentValidation" />
<PackageReference Include="NodaTime" />
<PackageReference Include="NodaTime.Serialization.SystemTextJson" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions src/Swashbuckle/SwashbuckleConvention.cs
Expand Up @@ -10,6 +10,8 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.OpenApi.Any;
using Microsoft.OpenApi.Models;
using NodaTime;
using NodaTime.Serialization.SystemTextJson;
using Rocket.Surgery.AspNetCore.Swashbuckle;
using Rocket.Surgery.Conventions;
using Rocket.Surgery.Extensions.DependencyInjection;
Expand Down Expand Up @@ -101,14 +103,12 @@ public void Register(IServiceConventionContext context)
}
}
);

AddFluentValdiationRules(context.Services);
}

private static void AddFluentValdiationRules(IServiceCollection services)
{


services.AddSingleton(
new FluentValidationRule("NotEmpty")
{
Expand Down

0 comments on commit 09ee140

Please sign in to comment.