From 09ee140ba2e9ba51deb8f79dc6e34625a4fe0a29 Mon Sep 17 00:00:00 2001 From: David Driscoll Date: Sun, 12 Jan 2020 22:47:35 -0500 Subject: [PATCH] Updated swashbuckle --- Packages.props | 2 ++ ...ket.Surgery.AspNetCore.Swashbuckle.NewtonsoftJson.csproj | 2 +- .../SwashbuckleNewtonsoftJsonConvention.cs | 6 +++++- .../Rocket.Surgery.AspNetCore.Swashbuckle.csproj | 3 +-- src/Swashbuckle/SwashbuckleConvention.cs | 6 +++--- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Packages.props b/Packages.props index 7bdf211..4d30938 100644 --- a/Packages.props +++ b/Packages.props @@ -25,6 +25,8 @@ + + diff --git a/src/Swashbuckle.NewtonsoftJson/Rocket.Surgery.AspNetCore.Swashbuckle.NewtonsoftJson.csproj b/src/Swashbuckle.NewtonsoftJson/Rocket.Surgery.AspNetCore.Swashbuckle.NewtonsoftJson.csproj index 20c9b2f..ae76ddd 100644 --- a/src/Swashbuckle.NewtonsoftJson/Rocket.Surgery.AspNetCore.Swashbuckle.NewtonsoftJson.csproj +++ b/src/Swashbuckle.NewtonsoftJson/Rocket.Surgery.AspNetCore.Swashbuckle.NewtonsoftJson.csproj @@ -6,8 +6,8 @@ + - diff --git a/src/Swashbuckle.NewtonsoftJson/SwashbuckleNewtonsoftJsonConvention.cs b/src/Swashbuckle.NewtonsoftJson/SwashbuckleNewtonsoftJsonConvention.cs index d50a0f1..26921f4 100644 --- a/src/Swashbuckle.NewtonsoftJson/SwashbuckleNewtonsoftJsonConvention.cs +++ b/src/Swashbuckle.NewtonsoftJson/SwashbuckleNewtonsoftJsonConvention.cs @@ -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; @@ -31,7 +35,7 @@ public void Register(IServiceConventionContext context) { throw new ArgumentNullException(nameof(context)); } - + context.Services.AddSwaggerGenNewtonsoftSupport(); context.Services.Configure( options => diff --git a/src/Swashbuckle/Rocket.Surgery.AspNetCore.Swashbuckle.csproj b/src/Swashbuckle/Rocket.Surgery.AspNetCore.Swashbuckle.csproj index 4ddd6ed..ddc40d5 100644 --- a/src/Swashbuckle/Rocket.Surgery.AspNetCore.Swashbuckle.csproj +++ b/src/Swashbuckle/Rocket.Surgery.AspNetCore.Swashbuckle.csproj @@ -6,6 +6,7 @@ + @@ -13,7 +14,5 @@ - - diff --git a/src/Swashbuckle/SwashbuckleConvention.cs b/src/Swashbuckle/SwashbuckleConvention.cs index 57b3a47..33ced23 100644 --- a/src/Swashbuckle/SwashbuckleConvention.cs +++ b/src/Swashbuckle/SwashbuckleConvention.cs @@ -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; @@ -101,14 +103,12 @@ public void Register(IServiceConventionContext context) } } ); - + AddFluentValdiationRules(context.Services); } private static void AddFluentValdiationRules(IServiceCollection services) { - - services.AddSingleton( new FluentValidationRule("NotEmpty") {