Sparse fields with 'Views'


#1

Hi

I’m wondering if the following approach would still be compliant with JsonApi:
Instead of having a user/client request the fields to be retrieved from the database, store different ‘views’ on certain collections in the database. Now instead of calling:
…/api/movies?fields[movies]=field1,field2,field3
the client could call
…/api/movies/views/1234

where the view with ID 1234 contains the field names ‘field1, field2, field3’…

Would that be an option or somehow break the JsonApi specs?


#2

What is a view exactly?