"when" and "with_items" again, with a twist

Hi,

I’m getting an error when using “when” and “with_items” together. As I’ve read many times, this happens because “when” runs inside “with_items”, so we can use “| default()” to bypass the error, but I think I found a new twist on it. Here’s an example:

`
$ cat example.yml

Anybody figure out to get around these deprecation warnings?

default only applies to the 'last' item, so if you are going to do
several depths of var defintion that can be undefined, you should have
several defaults.

"{{ (example.json|default({})).url | default() }}"

Thanks Brian. Just saw that example in another post. It does work of course, but boy is it ugly.