code-corps/deprecated-code-corps-rails-api

Find better way of documenting coalesced ids

Closed this issue · 0 comments

Per @begedin's comments:

This is the last thing that bugs me in the documentation at the moment. JSON API (and ember-data) coalesce ids by applying the following hash to the query string:

{
  filter: {
    id: "1,2,3,etc"
  }
}

This then ends up serialized in a get request as ?filter[id]=1,2,3. Thing is, it looks like API Blueprint doesn't support that. Giving a hash as a parameter fails completely, as does an object. Providing filter[id] as a single parameter, as done here, sort of works, but still not really, since it doesn't apply it to the test request we can do on the documentation page. I'm not sure if there's a better way to do this, so I'm open for suggestions.