Hey folks, must I return all attributes in a resource object when sparse fields are not specified? I’m curious because my entities contain quite a bit of information that’s not absolutely required with each request and I’m stuck in a spot where I’d be specifying many fields for each request.
A couple of thoughts I’ve had when returning a “minimal” set of attributes:
- When more attributes are requested, prefix fields with a “+” (e.g.
fields[article]=+title,+datewould add title and date if they aren’t part of the minimal set of attributes)
- When less attributes are requested, prefix fields with a “-” (e.g.
fields[article]=-titlewould remove title from the response when title is part of the minimal set of attributes)
- In order to provide the client with a list of available attributes, use
metato describe the entire set of available attributes