fix: an empty variable is []

This commit is contained in:
egarette@silique.fr 2025-03-26 19:34:00 +01:00
parent 75fc04c501
commit 9159f44efa

View file

@ -240,6 +240,9 @@ class RougailOutputFormatter:
# if boolean, the default value is True
del variable["type"]
variable["default"] = True
if "default" not in variable and variable.get("multi") is True and not set(variable) - {'default', 'description', "multi"}:
variable["default"] = []
del(variable['multi'])
if not isinstance(variable.get("default"), dict) and not set(variable) - {'default', 'description'}:
# shorthand notation
default = variable.get('default')