I have similar policy in my proxy :
<ExtractVariablesname="Extract-valid-until-date" continueOnError="false" > <DisplayName>Extract token chorus</DisplayName> <Source>chorusresponse</Source> <JSONPayload> <Variablename="valid_until"> <JSONPath>$.valid_until</JSONPath></Variable> <Variablename="response_error"> <JSONPath>$.error</JSONPath></Variable> </JSONPayload> </ExtractVariables>
If valid_until variable is not present in request, it throws an error :
{"fault":"{\"detail\":{\"errorcode\":\"steps.extractvariables.InvalidJSONPath\"},\"faultstring\":\"Invalid JSON path $.valid_until in policy Extract-valid-until-date.\"}"}
if i changed continueOnError="true", then it moves ahead but it doesn't capture second element value as well because the error has come on 1st element and policy was terminated there itself. I can use JS as well for my purpose. But is there any way to handle in extract variable policy ?
Thanks