diff --git a/src/Tgstation.Server.Host/Configuration/SecurityConfiguration.cs b/src/Tgstation.Server.Host/Configuration/SecurityConfiguration.cs index b78cf55b9a..a6073538cd 100644 --- a/src/Tgstation.Server.Host/Configuration/SecurityConfiguration.cs +++ b/src/Tgstation.Server.Host/Configuration/SecurityConfiguration.cs @@ -1,4 +1,7 @@ using System.Collections.Generic; +using System.Linq; + +using Swashbuckle.AspNetCore.SwaggerGen; using Tgstation.Server.Api.Models; @@ -62,6 +65,27 @@ namespace Tgstation.Server.Host.Configuration /// /// OAuth provider settings. /// - public IDictionary OAuth { get; set; } + public IDictionary OAuth + { + get => oAuth; + set + { + // Workaround for https://github.com/dotnet/runtime/issues/89547 + var publicProperties = typeof(OAuthConfiguration) + .GetProperties() + .Where(property => property.CanWrite && property.SetMethod.IsPublic) + .ToList(); + oAuth = value + .Where( + kvp => !publicProperties.All( + prop => prop.GetValue(kvp.Value) == prop.PropertyType.GetDefaultValue())) + .ToDictionary(kvp => kvp.Key, kvp => kvp.Value); + } + } + + /// + /// Backing field for . + /// + IDictionary oAuth; } }