clap-for-youth / api

API for CLAP
GNU General Public License v2.0
1 stars 0 forks source link

Add filtering for output #6

Open clapforyouth opened 9 years ago

clapforyouth commented 9 years ago

I suggest to add some output filter for the output fields.

Suppose GET /users output will be { "parameter1": "value1", "parameter2": "value2", "parameter3": "value3", "parameter4": "value4", "group": [ ... ... ] }

What I want is to filter the output like:

{ "parameter1": "value1", "parameter4": "value4", "group": [// only 2 groups data ] }

Just like Facebook's Graph API: ?field=paramete1,parameter2,limit(5),group{name,limit(2)}

Any suggestions?

NaturalLam commented 9 years ago

I don't know what you mean, please describe the task better if it's going to assign to others.

clapforyouth commented 9 years ago

Using the params like: ?field=name,email,limit(5),group{name,limit(2)}

treeleung commented 9 years ago

You mean Facebook's Graph API (https://developers.facebook.com/docs/graph-api/using-graph-api/v2.4)? Your examples seem a little bit different from theirs, but IMO it's a good idea to do filtering in this way.