I have APIM policy where I am using following policy
<choose>
<when condition="@(!(context.Variables.GetValueOrDefault<string>("Value").Contains("admin")))">
<return-response>
<set-status code="403" reason="Forbidden" />
</return-response>
</when>
</choose>
When policy parsing at run it throw error
"details": "Unable to convert context variable Value
of type Microsoft.WindowsAzure.ApiManagement.Proxy.Gateway.PipelineResponse
to the type of System.String
.\r\n at Microsoft.WindowsAzure.ApiManagement.Proxy.Gateway.Context.ExpressionSyntaxExtensions.GetValueOrDefault[T](IReadOnlyDictionary`2 dictionary, String key, T defaultValue)"