diff --git a/deploy/convert_server.py b/deploy/convert_server.py index 591d282..003aad7 100755 --- a/deploy/convert_server.py +++ b/deploy/convert_server.py @@ -144,9 +144,15 @@ class Handler(BaseHTTPRequestHandler): if not docs: continue ej = docs[0]["elements_json"] + # Lucee JSONB может вернуть: строку, dict-обёртку {Value,Type}, или уже список if isinstance(ej, dict) and "Value" in ej: ej = ej["Value"] - elements = json.loads(ej) + if isinstance(ej, str): + elements = json.loads(ej) + elif isinstance(ej, list): + elements = ej + else: + elements = [] # Lucee serializeJSON → UPPERCASE keys, normalize to lowercase elements = [{k.lower(): v for k, v in el.items()} for el in elements] lines = []