diff --git a/fastapi_hypermodel/hal/hal_hypermodel.py b/fastapi_hypermodel/hal/hal_hypermodel.py index 9e0ae31..8c365dd 100644 --- a/fastapi_hypermodel/hal/hal_hypermodel.py +++ b/fastapi_hypermodel/hal/hal_hypermodel.py @@ -220,7 +220,7 @@ def add_hypermodels_to_embedded(self: Self) -> Self: embedded: Dict[str, Union[Self, Sequence[Self]]] = {} for name, field in self: value: Sequence[Union[Any, Self]] = ( - field if isinstance(field, Sequence) else [field] + field if isinstance(field, Sequence) and len(field) else [field] ) if not all(isinstance(element, HALHyperModel) for element in value):