Added basic support for array query parameters #61

Closed
wants to merge 4 commits into
from

3 participants

@stou

Example of how to specify:

{
"Name":"arrayParam",
"Type":"array",
"Description":"Array of values"
}

Example of resulting query string:

… ?param[0]=first-value&param[1]=second-value

stou added some commits Dec 18, 2012
@stou stou Basic support for array query parameters
Example of how to specify:

{
  "Name":"arrayParam",
  "Type":"array",
  "Description":"Array of values"
}            

Example of resulting query string:

 … ?param[0]=first-value&param[1]=second-value
d48364b
@stou stou Removed console log to make IE happy 325da28
@stou stou Url encoded params in url path b61802a
@stou

I have also added url encoding of URI placeholders to try to fix issue #61

@mansilladev

Thanks for the pull request. Could you provide a sample config in the public/data directory so that people know how to use this feature?

@mansilladev

Rasmus, I've sparked a discussion over on Google+ about passing arrays in the query string.

https://plus.google.com/117717178917897844920/posts/ZCLLVZb3w7x

I was wondering if you could chime in here (or there on G+). Does your API also accept the following as an unordered array?

http://foo.bar/resource/method?name=neil&name=rasmus

I'd like us to consider covering different permutations of array passing that are out there when an API call is instantiated in I/O Docs. So, the I/O Docs multi-value array interface is the same, however, when a call is made, it could be sent as one of the following (depending on a new array request attribute):

  • ?name=neil&name=rasmus
  • ?name[0]=neil&name[1]=rasmus
  • ?name=neil,rasmus
@stou
@phairow

closing since this is old and cannot be merged as is. array parameters in querystring seem like a valid request and we need to find a solution that works for all serialization techniques.

@phairow phairow closed this Oct 9, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment