Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,939 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have an Azure API Management policy that displays a warning when saved, but it functions correctly works for my needs.
But some clients encounter errors when saving, such as in the policy snippet below.
<set-variable name="labels" value="@{
var labelsRaw = $"{{Labels}}".Split(',').Select(label => label.Trim().Split(':'));
JObject labels = new JObject();
foreach (string[] label in labelsRaw) {
if (label.Length == 2) {
labels.Add(label[0], label[1]);
}
}
if (labels.Count == 0) {
return "";
}
return $"\"labels\":{labels.ToString()},";
}" />
Could you clarify why this issue happens?