richardschneider / yappy

Yet another REST API server howling at the moon with JSON
MIT License
2 stars 0 forks source link

GET ?only #115

Closed richardschneider closed 8 years ago

richardschneider commented 8 years ago

As a devops I want to request a subset of the resource(s) data So that I can minimize bandwidth and make my app faster

The ?only query parameter accepts a JSON Pointer as its value. This is the subset of data that is to be returned. If the data is scalar (string, number or boolean) then content-type: text/plain otherwise application/json.

With multiple data being requested, GET /api/resource/123?only=/a&only=/b,data is returned as an object whose key is the JSON pointer.

This should be implemented as middle-ware so that the data providers to not have to worry about it.