Skip to content

Commit

Permalink
propagate convert_type_defination
Browse files Browse the repository at this point in the history
  • Loading branch information
Licini committed Jul 31, 2024
1 parent 34e9f9d commit 38f34fd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
4 changes: 2 additions & 2 deletions src/compas_ifc/entities/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)):
Expand All @@ -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):
Expand Down

0 comments on commit 38f34fd

Please sign in to comment.