zooniverse / json-api-client

Apache License 2.0
10 stars 5 forks source link

Array style params #1

Closed chrissnyder closed 9 years ago

chrissnyder commented 9 years ago

Not sure if this is an issue per-se with the library.

For array-style params, it currently encodes them like so:

testParams = {
  someArray: ['foo", 'bar']
}

http://www.example.com/?someArray=foo,bar

I couldn't find an RFC that specified a best-practices there. That said, Rails expects arrays to be in the following format:

http://www.example.com/?someArray[]=foo&someArray[]=bar

For context, I ran into this on the Talk API where the search route allows you to specify different types to search under, but it expects it in the second form.

brian-c commented 9 years ago

This was a client for (an old version of) the JSON API spec: http://jsonapi.org/format/. In practice it's ending up being pretty Panoptes-specific. Talk should be following Panoptes. If it's not, this library might not be appropriate for it.