Skip to content

Expand Argument Not Respected When Empty #108

@davidgolden

Description

@davidgolden

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions