diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e369d3..d323cc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +* Fixed `Base.to_dict()` to recursively pass down convert_type_defination. + ### Removed diff --git a/src/compas_ifc/entities/base.py b/src/compas_ifc/entities/base.py index 1a6986e..48daa8c 100644 --- a/src/compas_ifc/entities/base.py +++ b/src/compas_ifc/entities/base.py @@ -165,7 +165,7 @@ def iter_list(values): _values = [] for value in values: if isinstance(value, Base): - value = value.to_dict(recursive=recursive, ignore_fields=ignore_fields, include_fields=include_fields) + value = value.to_dict(recursive=recursive, ignore_fields=ignore_fields, include_fields=include_fields, convert_type_definitions=convert_type_definitions) elif convert_type_definitions and isinstance(value, TypeDefinition): value = value.value elif isinstance(value, (list, tuple)): @@ -184,7 +184,7 @@ def iter_list(values): value = getattr(self, key) if recursive and isinstance(value, Base): - value = value.to_dict(recursive=recursive, ignore_fields=ignore_fields, include_fields=include_fields) + value = value.to_dict(recursive=recursive, ignore_fields=ignore_fields, include_fields=include_fields, convert_type_definitions=convert_type_definitions) elif recursive and isinstance(value, (list, tuple)): value = iter_list(value) elif convert_type_definitions and isinstance(value, TypeDefinition):