, Does above policy executes even if key is not present ? Ideally i would like to detect whether a key exists without a value. Something like check variable is defined or not even though it doesn’t have any value
It does. You could set the default value to something no one would enter, like “xxxyyyzzz”, and then check request.queryparam.comapny against that value.
Right - I was saying that this will set the query param to “xxxyyyzzz” only when the query param is null. If the user passes a value for it in the request, then the query param will be set as specified by the user.
The following tests for values in a queryparam and raises a fault only if the value is null - essentially executing the raiseFault policy if the queryparam were omitted: