Hi ,
TIA, I'm trying to validate Query Parameter with Named values using Transformation policy.
Named Value : allowedUserNames: "User1","User2",User3"
Policy
<policies>
<inbound>
<choose>
<when condition="@( !(new List<string>{{{allowedUserNames}}}.Any(c => c == context.Request.OriginalUrl.Query.GetValueOrDefault("userId"))))">
<return-response>
<set-status code="403" reason="Invalid user name" />
</return-response>
</when>
</choose>
<base />
<set-backend-service base-url="{{demoApiBackendBaseUrl}}" />
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
</outbound>
<on-error>
<base />
</on-error>
</policies>
When i compile this policy, i receive fallowing error.
Error:
One or more fields contain incorrect values
. Error in element 'choose' on line 16,coloumn 10 : 'Group' is a type,which is not valid in the given context.
Please let me know how to solve this.
Tia