Update get_value
This commit is contained in:
parent
94ef48fafc
commit
920164060e
|
|
@ -7,13 +7,16 @@
|
||||||
{# Initialize the result with the input dictionary #}
|
{# Initialize the result with the input dictionary #}
|
||||||
{% set result = dict %}
|
{% set result = dict %}
|
||||||
|
|
||||||
|
{# Use a flag to detect when to stop processing #}
|
||||||
|
{% set valid = true %}
|
||||||
|
|
||||||
{# Iterate through the keys and traverse the dictionary #}
|
{# Iterate through the keys and traverse the dictionary #}
|
||||||
{% for key in keys %}
|
{% for key in keys %}
|
||||||
{% if result is mapping and key in result %}
|
{% if valid and result is mapping and key in result %}
|
||||||
{% set result = result[key] %}
|
{% set result = result[key] %}
|
||||||
{% else %}
|
{% else %}
|
||||||
{% set result = none %}
|
{% set result = none %}
|
||||||
{% break %}
|
{% set valid = false %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue