Hi,
I have defined a variable in a javascript, but while getting that variable in the next policy and comparing it, it is giving wrong result.
I have set a variable named extractvar in java script which is the first policy in my apiproxy. the next policy is validate apikey which has to be run/skipped w.r.t. this variable "extractvar".
But in trace when check, I can see two variable with the same name, but the second one is with a curly bracket at the end.
extractvar
extractvar}
And the validate apikey policy is checking the second variable and giving a wrong result.
condition in proxy--
<Step>
<Name>VerifyAPIKey</Name>
<Condition>{extractvar}=0</Condition>
</Step>
tracing result---
expression (apikeyvalue} equals 0)
expressionResult false
Can someone tell me why this second variable is coming.
Solved! Go to Solution.
Hi @krushna.padhee.ap,
The variable need not be enclosed with braces {variable_name} in <Condition> Tag while defining the step.
The following should work. Hope this helps, thank you!
<Step> <Name>VerifyAPIKey</Name> <Condition>extractvar = 0</Condition> </Step>