Skip to content

Conversation

@awswim
Copy link
Contributor

@awswim awswim commented Jun 18, 2014

Technically it's not a HTTP standard, but many APIs accept a 1:many relationship in HTTP parameters so long as those parameters have [] brackets.

Example supporting multiple user IDs:

api?user_ids[]=1&user_ids[]=34&user_ids[]=33

I'm adding support for those parameters to RequestBuilder.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add descriptions to the JavaDoc on these methods that explains the format that they are putting them in so that it's clear? Explain that it's using the KEY[]=... pattern so that it's explicit and clear.

@dylanrjames
Copy link
Contributor

I've never seen this format before, seems a bit strange to me, but we can support it if it's not impacting anything else. Is there a more "official" name for this? Or can we use something more descriptive? ListParams seems a little strange to me, but maybe array params or something?

@awswim
Copy link
Contributor Author

awswim commented Jul 14, 2014

I called it MultipleValueParam, because the idea is that typically most parameters are 1:1 key:value pairs while these are 1:many key:value pairs.

Let me know if you think it would be better as ArrayParam or ManyValueParam.

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

Successfully merging this pull request may close these issues.

2 participants