Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple values under the same query parameter name #83

Open
andreyfilyakov opened this issue Oct 24, 2022 · 2 comments
Open

Comments

@andreyfilyakov
Copy link

Is your feature request related to a problem? Please describe.
In our project we have some requests which require multiple values for the same parameter name, e.g. <base_url>?param=value1&param=value2&param=value3. We tried to use QueryMap annotation to achieve our goal, but it works with Map<String, String> only, so it's not possible to set multiple values for the same key.

Describe the solution you'd like
It'd be ideal to support Map<String, List<String>> for QueryMap annotation.

@Foso
Copy link
Owner

Foso commented Oct 26, 2022

Hi @andreyfilyakov , you can do that with Query and a List
suspend fun testQueryWithList( @Query("param") name: List<String>)

I will think about adding additional ways to enable that

@andreyfilyakov
Copy link
Author

Hi @Foso! Your idea should work, but what if I have dynamic set of parameters with dynamic list of values for each parameter like this:

  • param1: [value1, value2, ..., valueN]
  • param2: [value1, value2, ..., valueN]
  • ...
  • paramM: [value1, value2, ..., valueN]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants