IgnoreUnresolvedVariables not working as expected within ExtractVariables POLICY

The IgnoreUnresolvedVariables option is not working as per Apigee documentation.

If we are not setting the value of this field, it should take false as default value but when we are extracting any value from header , URI, query or formparam , and the particular field we are not passing in request then also this policy executing successful and creating variable with that particular name.

But in case of extracting value from json payload or XML payload, it's working as expected as per Apigee documentation.

Can anyone please help on this.@dino-at-google

Solved Solved
0 10 1,161
1 ACCEPTED SOLUTION

FYI: Check if it matches your question.

Issue with the Extract Variable policy, specifically in the IgnoreUnresolvedVariables setting. If the element is missing, it used to ignore and continue, but post upgrade to newer versions, if the element doesn’t exist, it fails.

This is likely due to an issue which was present in Private Cloud version 4.19.06.07. Specifically, when an XML variable was not resolved via an XPath expression, the ExtractVariables policy continued to execute in the proxy. This occurred even when the IgnoreUnresolvedVariables element or the continueOnError attribute were set to false.

This issue appears to have been resolved in 4.50.00 and is now working as intended.

View solution in original post

10 REPLIES 10

Hi, this is actually how ExtractVariables policy works. Whether you set IgnoreUnresolvedVariable true or false it wont throw an error for variables you'r not passing, it treat them as null which is resolved.

Hi,

Then what is the use of IgnoreUnresolvedVariable field.

Then what's the use of IgnoreUnresolvedVariable field and as per document it should behave like this

I'm not an expert but Im guessing this property is mainly for XPATH or JSONPath expressions. For other variable mappings, any variable that referenced either can be exist or not exist and both way it is considered resolved. See xpath and jsonpath expressions run a logic and it could be unresolved but not others. If there is a case that other variable mappings also work like expressions then maybe we can see this property take an action there too.

We also noticed this error, I think we are seeing this since Apigee version: 4.19.06.

Prior to this release, when "IgnoreUnresolvedVariable" was false, it used to set the variable as null when the property we are looking is missing in XML/JSON payload.

Now, its forcing us to define it as "false" explicitly, otherwise would throw an error. I think it was a bug earlier that got fixed from Apigee 4.19.06.

Yes , you are correct sameame thing is happening to us also. And as per document it's by default false but it's not taking false as default , we need to define explicitly.

I'm not quite clear on the problem you're describing.

I think you have ExtractVariables policy, in which the IgnoreUnresolvedVariables element is either not present, or is present and is set to false. Is that right??

And I think you are testing this policy with extraction of variables from two sets of sources:

  1. header, URI param, formparam or queryparam
  2. JSON or XML

And I think you are describing a difference in behavior when using sources from those sets, a difference that you don't expect.

When a variable is not extracted successfully from the first set, then...? And when a variable is not extracted successfully from the second set, then... ? And what specifically is the difference?

I think maybe in the first set, you get a variable that is set to null. And in the second set, you get.... ?? I am not sure. You said "working as expected" but I am not clear on what you mean by that.

If you could be specific about what you're seeing and what you're expecting to see, that would be helpful to me.

Side note: I am unsure if Apigee treats variables explicitly set to null, as different from variables that are unset. So if. your observation is: in one case Apigee sets the variable to null, and in the other case Apigee does not set the variable, Could you help me understand how you are observing the difference in practice?

FYI: Check if it matches your question.

Issue with the Extract Variable policy, specifically in the IgnoreUnresolvedVariables setting. If the element is missing, it used to ignore and continue, but post upgrade to newer versions, if the element doesn’t exist, it fails.

This is likely due to an issue which was present in Private Cloud version 4.19.06.07. Specifically, when an XML variable was not resolved via an XPath expression, the ExtractVariables policy continued to execute in the proxy. This occurred even when the IgnoreUnresolvedVariables element or the continueOnError attribute were set to false.

This issue appears to have been resolved in 4.50.00 and is now working as intended.

Yes Vinay you are correct ,exactly the same issue . I think it was a bug in 4.19 version and the Apigee has fixed in the 4.50 version.

Whoo-hoo, thanks Vinay