โ09-08-2017 01:27 PM
I am getting the following warning during pipeline execution, where can I find more details? What is the suggested actions?
WarningPassing: a JSON-Path to hasOwnProperty() is not supported and will fail in the future
ResolutionUse: hasOwnProperty() for each component of the path
โ09-08-2017 01:37 PM
The hasOwnProperty() documentation has some notes on the change. Basically, the method behaved differently than how it is defined in JavaScript, which the expression language is based around. Since we want to follow the existing standard to avoid surprising people familiar with JavaScript, weโre issuing the warning and trying to move people away from the non-standard usage.
In your case, it sounds like youโre testing for a JSON-Path and not a plain property name. If youโre only testing for a property directly in the object (e.g. $name) and not a descendant (e.g. $foo.bar), you can just remove the dollar sign. If you are drilling down into sub-objects, then youโd need to check for each intermediate object using hasOwnProperty, the โinโ operator, or the โget()โ method. In the near future, weโll add support for specifying a default value in the jsonPath() function to make this case easier.