fix: crash when encountering GetLolVanguardV1Notification

This commit is contained in:
estrogen elf
2025-06-13 23:49:13 -05:00
parent 53a393ee1a
commit c571f5a1de

View File

@@ -253,8 +253,9 @@ public partial class OperationViewModel : ObservableObject
return "none";
}
public static string GetSchemaType(OpenApiSchema schema)
public static string GetSchemaType(OpenApiSchema? schema)
{
if (schema == null) return "object"; // Because GetLolVanguardV1Notification exists where it has a required parameter without a type...
if (schema.Reference != null) return schema.Reference.Id;
if (schema.Type == "object" && schema.AdditionalProperties?.Reference != null) return schema.AdditionalProperties.Reference.Id;
if (schema.Type == "integer" || schema.Type == "number") return $"{schema.Type}:{schema.Format}";