Fixed double shift implementation. Added implicit renaming

This commit is contained in:
2025-07-24 21:42:13 +02:00
parent 34f959812b
commit 1ceddfac7c
3 changed files with 34 additions and 1 deletions

View File

@@ -45,7 +45,7 @@ class DefaultDataPresenter(DataPresenter):
mappings[key] = key
elif key.endswith(".*"):
# all fields in a sub-object
if value != "*":
if value != "*" and value != "":
raise ValueError("Only '*' is accepted when renaming wildcard.")
obj_path = key[:-2]
sub_obj = data.get(obj_path)
@@ -86,6 +86,8 @@ class DefaultDataPresenter(DataPresenter):
for mapping in self._split_definitions:
if "=" in mapping:
key, value = [s.strip() for s in mapping.split('=', 1)]
if not value:
value = key.split(".")[-1]
mappings[key] = value
else:
mappings[mapping] = mapping