diff --git a/rest_framework/serializers.py b/rest_framework/serializers.py index ea2daffd5..ac7e39892 100644 --- a/rest_framework/serializers.py +++ b/rest_framework/serializers.py @@ -608,10 +608,15 @@ class ListSerializer(BaseSerializer): super().__init__(*args, **kwargs) self.child.bind(field_name='', parent=self) - def get_initial(self): - if hasattr(self, 'initial_data'): - return self.to_representation(self.initial_data) + def get_initial(self): + if hasattr(self, 'initial_data'): + # If data is given, we should just return the raw input structure, + # but ensure it's represented in a consistent list format. + if isinstance(self.initial_data, list): + return [self.child.get_initial() for _ in self.initial_data] return [] + return [] + def get_value(self, dictionary): """