jsonapi-suite / jsonapi_compliable

MIT License
20 stars 35 forks source link

Add stats API #2

Closed richmolj closed 7 years ago

richmolj commented 7 years ago

Adds ability to calculate stats in 'meta' against the scope. eg:

GET /api/v1/posts?stats[total]=count&stats[rank]=average,maximum

returns

{
  data: [],
  meta: {
    stats: {
      total: { count: 100 },
      rank: { average: 3.3, maximum: 10 }
    }
  }
}