Skip to content

Commit b7f895f

Browse files
committed
Server variables fix
1 parent 77ff8f3 commit b7f895f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

Assets/UnityOpenApi/OA Models/OAServer.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ public OAServer(OpenApiServer s)
2424
Enum = new List<string>(v.Value.Enum),
2525
Current = v.Value.Enum.IndexOf(v.Value.Default)
2626
}).Values.ToList();
27+
28+
Variables.ForEach(v =>
29+
{
30+
v.Default = v.Default.Trim('/');
31+
if (v.Enum.Count == 0)
32+
{
33+
v.Enum = new List<string> { v.Default };
34+
} else
35+
{
36+
// trim all slashes for variants
37+
v.Enum = new List<string>(v.Enum.Select(e => e.Trim('/')));
38+
}
39+
v.Current = 0;
40+
});
2741
}
2842
}
2943
}

0 commit comments

Comments
 (0)