FriendsOfCake / crud-json-api

Build advanced JSON API Servers with almost no code.
https://crud-json-api.readthedocs.io/
MIT License
56 stars 32 forks source link

JsonApiListener does not respect "include" query parameter if "fields" query parameter is used. #174

Open geoidesic opened 2 years ago

geoidesic commented 2 years ago

E.g.

{{protocol}}{{domain}}/api/people/3c9b642a-6682-4b7a-aff2-1928371923719?fields[people]=role&include=role

This will not include any data and currently produces the same result as this query:

{{protocol}}{{domain}}/api/people/3c9b642a-6682-4b7a-aff2-1928371923719?fields[people]=role

Which means that there is no way currently to fetch a single entity and only receive some of its related data, which means GET entity requests will be exponentially slower – a ticking time-bomb in your app. Nice. Hard to believe no-one noticed this before.