-
-
Notifications
You must be signed in to change notification settings - Fork 1
Description
In certain situations the default views of the metadata can be too verbose. A client might only need a few fields from each object and want to remove unnecessary fields from the response. To discover which fields are available for each object please see the schema documentation for each object type.
The format for include/exclude should be very simple and should allow for infinite recursion. To filter at the "root" level we can just use the name of the field, i.e. ?fields=id,name which would only display the id and name for every object. For objects that are either collections or complex objects with properties on their own you can use the format ?fields=id,name,members[id,name] which would return id, name of the root(SILC Group), and the id and name of every SILC Group Member on that object. Negation can be done with the exclamation operator, and we can have a set of presets of field select (see below). Only JSON should be supported in the first version of the API.
Example: Get id and name on the SILC Group:
/api/silc_groups?fields=id,name,members[id,name]
Example: Get with an exclude for specific fields would be:
/api/silc_groups?fields=:all,!id,members[:all,!id]
where !id means return every other field except the id field