Skip to content

Commit ac658f4

Browse files
authored
Apply root options to children nodes (#10)
1 parent 7ff3beb commit ac658f4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/xml_dataclasses/serde.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _unpack_union_child(
8686
# try to find one matching type
8787
for base_type in child.base_types:
8888
try:
89-
return load(base_type, value)
89+
return load(base_type, value, options=options)
9090
except ValueError as e:
9191
exceptions.append(e)
9292

@@ -118,8 +118,8 @@ def _get_one_child_value(child: ChildInfo) -> Any:
118118
# nice path for default use-case
119119
base_type = child.base_types[0]
120120
if child.is_list:
121-
return [load(base_type, v) for v in value]
122-
return load(base_type, value)
121+
return [load(base_type, v, options=options) for v in value]
122+
return load(base_type, value, options=options)
123123

124124
if child.is_list:
125125
return [_unpack_union_child(child, v) for v in value]

0 commit comments

Comments
 (0)