Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit 3c427df

Browse files
committed
ensure protocols aren't deleted
1 parent 7ca3970 commit 3c427df

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/APIM_ARMTemplate/apimtemplate/Creator/TemplateCreators/APITemplateCreator.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,11 @@ public string[] CreateProtocols(OpenApiDocument doc)
172172
List<string> protocols = new List<string>();
173173
foreach (OpenApiServer server in doc.Servers)
174174
{
175-
protocols.Add(server.Url.Split(":")[0]);
175+
string protocol = server.Url.Split(":")[0];
176+
if (protocols.Exists(p => p == protocol) == false)
177+
{
178+
protocols.Add(protocol);
179+
}
176180
}
177181
return protocols.ToArray();
178182
}

0 commit comments

Comments
 (0)