From dd0949b58dffca9fedea42b11f3e62c5301b4e8a Mon Sep 17 00:00:00 2001 From: Archi Date: Tue, 2 Jan 2024 01:19:28 +0100 Subject: [PATCH] Fix enum pointer failures in swagger schema --- ArchiSteamFarm/IPC/Startup.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ArchiSteamFarm/IPC/Startup.cs b/ArchiSteamFarm/IPC/Startup.cs index ef2304c78..e0e7bed6f 100644 --- a/ArchiSteamFarm/IPC/Startup.cs +++ b/ArchiSteamFarm/IPC/Startup.cs @@ -277,8 +277,8 @@ internal sealed class Startup { // We require custom schema IDs due to conflicting type names, choosing the proper one is tricky as there is no good answer and any kind of convention has a potential to create conflict // FullName and Name both do, ToString() for unknown to me reason doesn't, and I don't have courage to call our WebUtilities.GetUnifiedName() better than what .NET ships with (because it isn't) - // Let's use ToString() until we find a good enough reason to change it - options.CustomSchemaIds(static type => type.ToString()); + // Let's use ToString() until we find a good enough reason to change it, also, the name must pass ^[a-zA-Z0-9.-_]+$ regex + options.CustomSchemaIds(static type => type.ToString().Replace('+', '-')); options.EnableAnnotations(true, true);