Skip to content

Commit

Permalink
refactor: make schema names legal
Browse files Browse the repository at this point in the history
  • Loading branch information
revam committed Feb 9, 2025
1 parent 342681b commit 0ef1fe4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Shoko.Server/API/APIExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ private static string GetTypeName(string fullName)

var firstPart = fullName[..fullName.IndexOf('`')];
var secondPart = fullName[(fullName.IndexOf('`') + 3)..^1];
return ConvertTypeName(firstPart) + "<" + GetTypeName(secondPart) + ">";
return ConvertTypeName(firstPart) + "_" + GetTypeName(secondPart) + "_";
}

private static string ConvertTypeName(string fullName)
Expand All @@ -233,7 +233,7 @@ private static string ConvertTypeName(string fullName)
if (fullName.StartsWith("System.Collections.Generic."))
title = fullName.Split('.').Skip(3).Join('.');
else if (fullName.StartsWith("System.") || fullName.StartsWith("Microsoft."))
title = "Core." + fullName.Split('.').Skip(1).Join('.');
title = fullName.Split('.').Skip(1).Join('.');

// APIv0 (API independent plugin abstraction) schemas
else if (fullName.StartsWith("Shoko.Plugin.Abstractions."))
Expand Down

0 comments on commit 0ef1fe4

Please sign in to comment.