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.