Implemented code to come solution nearer

This commit is contained in:
Kevin Veen-Birkenbach 2025-01-10 03:46:16 +01:00
parent cdfefe5a63
commit 268c2eb452

View File

@ -27,7 +27,14 @@ class ConfigurationResolver:
if isinstance(current_config, dict):
# Traverse all key-value pairs in the dictionary
for key, value in list(current_config.items()):
if key == "link":
if key == "subitems" and isinstance(value, list):
# Überprüfen, ob die relevanten Subitems enthalten sind
subitems_to_promote = [item for item in value if item.get("link")]
if subitems_to_promote:
# Füge nur die relevanten Subitems direkt ein
current_config[key] = subitems_to_promote
elif key == "link":
# Found a `link` entry, attempt to resolve it
try:
print(f"Resolving link '{value}' at path '{path}'") # Debugging