diff --git a/src/client/Dangl.OpenCDE.Client/Dangl.OpenCDE.Client.csproj b/src/client/Dangl.OpenCDE.Client/Dangl.OpenCDE.Client.csproj index a13f76c..db14898 100644 --- a/src/client/Dangl.OpenCDE.Client/Dangl.OpenCDE.Client.csproj +++ b/src/client/Dangl.OpenCDE.Client/Dangl.OpenCDE.Client.csproj @@ -1,16 +1,17 @@ - net7.0 + net8.0 - - + + - - - - + + + + + diff --git a/src/client/Dangl.OpenCDE.Client/SignalRTypesProcessor.cs b/src/client/Dangl.OpenCDE.Client/SignalRTypesProcessor.cs new file mode 100644 index 0000000..b93b78b --- /dev/null +++ b/src/client/Dangl.OpenCDE.Client/SignalRTypesProcessor.cs @@ -0,0 +1,25 @@ +using NSwag.Generation.Processors.Contexts; +using NSwag.Generation.Processors; +using System.Linq; + +namespace Dangl.OpenCDE.Client +{ + public class SignalRTypesProcessor : IDocumentProcessor + { + public void Process(DocumentProcessorContext context) + { + var signalrTypes = typeof(Dangl.OpenCDE.Client.Models.OpenIdConnectAuthenticationResult) + .Assembly + .DefinedTypes + .Where(t => t.Namespace != null && t.Namespace + .StartsWith(typeof(Dangl.OpenCDE.Client.Models.OpenIdConnectAuthenticationResult).Namespace)); + foreach (var type in signalrTypes) + { + if (!context.SchemaResolver.HasSchema(type, false)) + { + context.SchemaGenerator.Generate(type, context.SchemaResolver); + } + } + } + } +} diff --git a/src/client/Dangl.OpenCDE.Client/SwaggerExtensions.cs b/src/client/Dangl.OpenCDE.Client/SwaggerExtensions.cs index d69f062..93c478d 100644 --- a/src/client/Dangl.OpenCDE.Client/SwaggerExtensions.cs +++ b/src/client/Dangl.OpenCDE.Client/SwaggerExtensions.cs @@ -1,7 +1,6 @@ using Dangl.OpenCDE.Shared; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.DependencyInjection; -using NJsonSchema; using NSwag; using System.Collections.Generic; using System.Linq; @@ -17,6 +16,7 @@ public static void AddCdeClientSwaggerServices(this IServiceCollection services) c.Description = "OpenCDE Client Specification"; c.Version = VersionsService.Version; c.Title = $"OpenCDE Client {VersionsService.Version}"; + c.DocumentProcessors.Add(new SignalRTypesProcessor()); c.PostProcess = (x) => { @@ -51,22 +51,6 @@ public static void AddCdeClientSwaggerServices(this IServiceCollection services) property.AllOf.Clear(); } } - - var signalrTypes = typeof(Dangl.OpenCDE.Client.Models.OpenIdConnectAuthenticationResult) - .Assembly - .DefinedTypes - .Where(t => t.Namespace != null && t.Namespace - .StartsWith(typeof(Dangl.OpenCDE.Client.Models.OpenIdConnectAuthenticationResult).Namespace)); - foreach (var type in signalrTypes) - { - if (!x.Definitions.ContainsKey(type.Name)) - { - x.Definitions.Add(type.Name, JsonSchema.FromType(type, new NJsonSchema.Generation.JsonSchemaGeneratorSettings - { - SerializerSettings = c.SerializerSettings - })); - } - } }; }); } @@ -75,7 +59,6 @@ public static void AddCdeClientSwaggerServices(this IServiceCollection services) /// Adds the PfeifferAVA Swagger endpoints /// /// - /// /// public static IApplicationBuilder UseCdeClientSwaggerUi(this IApplicationBuilder app) { diff --git a/src/server/Dangl.OpenCDE.Core/Configuration/SwaggerExtensions.cs b/src/server/Dangl.OpenCDE.Core/Configuration/SwaggerExtensions.cs index 980b72d..4d0b4d0 100644 --- a/src/server/Dangl.OpenCDE.Core/Configuration/SwaggerExtensions.cs +++ b/src/server/Dangl.OpenCDE.Core/Configuration/SwaggerExtensions.cs @@ -156,7 +156,7 @@ private static void AddOpenCdeDocumentsApiSwaggerDocument(IServiceCollection ser /// public static IApplicationBuilder UseOpenCdeSwaggerUi(this IApplicationBuilder app, DanglIdentitySettings danglIdentitySettings) { - void ConfigureDanglIdentity(SwaggerUi3Settings settings) + void ConfigureDanglIdentity(SwaggerUiSettings settings) { settings.OAuth2Client = new OAuth2ClientSettings { @@ -176,7 +176,7 @@ void ConfigureDanglIdentity(SwaggerUi3Settings settings) }; }); - app.UseSwaggerUi3(settings => + app.UseSwaggerUi(settings => { ConfigureDanglIdentity(settings); @@ -208,7 +208,7 @@ void ConfigureDanglIdentity(SwaggerUi3Settings settings) }; }); - app.UseSwaggerUi3(settings => + app.UseSwaggerUi(settings => { ConfigureDanglIdentity(settings); diff --git a/src/server/Dangl.OpenCDE.Core/Dangl.OpenCDE.Core.csproj b/src/server/Dangl.OpenCDE.Core/Dangl.OpenCDE.Core.csproj index 1c6b9be..87720ae 100644 --- a/src/server/Dangl.OpenCDE.Core/Dangl.OpenCDE.Core.csproj +++ b/src/server/Dangl.OpenCDE.Core/Dangl.OpenCDE.Core.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 @@ -14,12 +14,12 @@ - - - - - - + + + + + + diff --git a/src/server/Dangl.OpenCDE.Data/Dangl.OpenCDE.Data.csproj b/src/server/Dangl.OpenCDE.Data/Dangl.OpenCDE.Data.csproj index 695ebb5..5d78f07 100644 --- a/src/server/Dangl.OpenCDE.Data/Dangl.OpenCDE.Data.csproj +++ b/src/server/Dangl.OpenCDE.Data/Dangl.OpenCDE.Data.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 @@ -10,10 +10,10 @@ - - + + - + diff --git a/src/server/Dangl.OpenCDE.Shared/Dangl.OpenCDE.Shared.csproj b/src/server/Dangl.OpenCDE.Shared/Dangl.OpenCDE.Shared.csproj index d8dd24e..8b5f0a5 100644 --- a/src/server/Dangl.OpenCDE.Shared/Dangl.OpenCDE.Shared.csproj +++ b/src/server/Dangl.OpenCDE.Shared/Dangl.OpenCDE.Shared.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 diff --git a/src/server/Dangl.OpenCDE/Dangl.OpenCDE.csproj b/src/server/Dangl.OpenCDE/Dangl.OpenCDE.csproj index 88eb6e4..b52bad8 100644 --- a/src/server/Dangl.OpenCDE/Dangl.OpenCDE.csproj +++ b/src/server/Dangl.OpenCDE/Dangl.OpenCDE.csproj @@ -1,7 +1,7 @@  - net7.0 + net8.0 @@ -9,14 +9,14 @@ - - - + + + - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/src/server/Dangl.OpenCDE/Dockerfile b/src/server/Dangl.OpenCDE/Dockerfile index c98a67a..b563d55 100644 --- a/src/server/Dangl.OpenCDE/Dockerfile +++ b/src/server/Dangl.OpenCDE/Dockerfile @@ -1,4 +1,4 @@ -FROM mcr.microsoft.com/dotnet/aspnet:7.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 @@ -7,4 +7,5 @@ FROM base AS final WORKDIR /app COPY . . ENV ASPNETCORE_FORWARDEDHEADERS_ENABLED=true +ENV ASPNETCORE_URLS=http://*:80 ENTRYPOINT ["dotnet", "Dangl.OpenCDE.dll"] diff --git a/tests/Dangl.OpenCDE.Core.Tests/Dangl.OpenCDE.Core.Tests.csproj b/tests/Dangl.OpenCDE.Core.Tests/Dangl.OpenCDE.Core.Tests.csproj index 24dece8..ce50123 100644 --- a/tests/Dangl.OpenCDE.Core.Tests/Dangl.OpenCDE.Core.Tests.csproj +++ b/tests/Dangl.OpenCDE.Core.Tests/Dangl.OpenCDE.Core.Tests.csproj @@ -1,24 +1,25 @@ - + - net7.0 + net8.0 false + NETSDK1206 - - - - + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/tests/Dangl.OpenCDE.TestUtilities/Dangl.OpenCDE.TestUtilities.csproj b/tests/Dangl.OpenCDE.TestUtilities/Dangl.OpenCDE.TestUtilities.csproj index ffe0193..8e0fa01 100644 --- a/tests/Dangl.OpenCDE.TestUtilities/Dangl.OpenCDE.TestUtilities.csproj +++ b/tests/Dangl.OpenCDE.TestUtilities/Dangl.OpenCDE.TestUtilities.csproj @@ -1,7 +1,8 @@  - net7.0 + net8.0 + NETSDK1206 @@ -9,9 +10,9 @@ - + - + diff --git a/tests/Dangl.OpenCDE.TestUtilities/TestData/Clients.cs b/tests/Dangl.OpenCDE.TestUtilities/TestData/Clients.cs index 735c981..71ab666 100644 --- a/tests/Dangl.OpenCDE.TestUtilities/TestData/Clients.cs +++ b/tests/Dangl.OpenCDE.TestUtilities/TestData/Clients.cs @@ -1,5 +1,5 @@ using Dangl.Identity.TestHost.SetupData; -using IdentityServer4.Models; +using Duende.IdentityServer.Models; using System.Collections.Generic; using System.Linq; diff --git a/tests/Dangl.OpenCDE.Tests.Integration/Dangl.OpenCDE.Tests.Integration.csproj b/tests/Dangl.OpenCDE.Tests.Integration/Dangl.OpenCDE.Tests.Integration.csproj index c732d0c..58379b7 100644 --- a/tests/Dangl.OpenCDE.Tests.Integration/Dangl.OpenCDE.Tests.Integration.csproj +++ b/tests/Dangl.OpenCDE.Tests.Integration/Dangl.OpenCDE.Tests.Integration.csproj @@ -1,25 +1,26 @@ - + - net7.0 + net8.0 false + xUnit1041;NETSDK1206 - - - - - + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/utils/Dangl.OpenCDE.DataSeed/Dangl.OpenCDE.DataSeed.csproj b/utils/Dangl.OpenCDE.DataSeed/Dangl.OpenCDE.DataSeed.csproj index a316329..14121a4 100644 --- a/utils/Dangl.OpenCDE.DataSeed/Dangl.OpenCDE.DataSeed.csproj +++ b/utils/Dangl.OpenCDE.DataSeed/Dangl.OpenCDE.DataSeed.csproj @@ -2,7 +2,8 @@ Exe - net7.0 + net8.0 + NETSDK1206