Skip to content

Support for a list of expansions with multiple expand parameters instead of separated by a comma. #137

@SorianoMarmol

Description

@SorianoMarmol

Hello. First of all, thank you for your work and effort with the library!

We have noticed that, despite expansions working correctly with multiple expansion parameters:

expand=field1&expand=field2 instead of ?expand=field1,field2

the 'is_expanded' function does not respond appropriately due to the use of 'request.query_params.get(EXPAND_PARAM).'
In the case of receiving a list, it only returns one of the values.

However, the 'getlist' method does return both fields.
I illustrate it with an example:

# expand=field1&expand=field2
ipdb> self.request.query_params
<QueryDict: {'expand': ['asset', 'positions']}>
ipdb> self.request.query_params.getlist('expand')
['field1', 'field2']
ipdb> self.request.query_params.get('expand')
'field2'

In this case, it's already a list.

Would it be possible to manage this scenario as well?

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