I would expect that when instantiating a serializer and explicitly setting the expand argument, that would be respected no matter what. Instead, the behavior is that if there is an expand query param, that is respected over an empty list argument because empty lists are falsy. Here is the logic in question:
"expand": (
self._get_permitted_expands_from_query_param(EXPAND_PARAM)
if not expand
else []
),
Maybe this is the intended behavior but it seems strange to me. Feature or bug?
I would expect that when instantiating a serializer and explicitly setting the expand argument, that would be respected no matter what. Instead, the behavior is that if there is an expand query param, that is respected over an empty list argument because empty lists are falsy. Here is the logic in question:
Maybe this is the intended behavior but it seems strange to me. Feature or bug?