Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sparse Fieldsets exclusion implentation #91

Open
RandyRomero opened this issue Jul 2, 2024 · 0 comments
Open

Sparse Fieldsets exclusion implentation #91

RandyRomero opened this issue Jul 2, 2024 · 0 comments

Comments

@RandyRomero
Copy link

RandyRomero commented Jul 2, 2024

First of all, thank you for your work!

The issue I'll describe here is a minor things and more like a nit-picking than an actual problem.
One of pros JSONAPI API'S is that the client can specify what set of fields it want to be returned (instead of all fields)

https://jsonapi.org/format/#fetching-sparse-fieldsets

FastAPI-JSONAPI supports this feature, but in their own way. It selects all the fields from a database table, then get rid of unneeded once while preparing the response. So fields that are not requested by the client are not transferred via HTTP, but still get pulled from the database. It is not critical, but also is not optimal. I am wondering why you don't exclude fiends while building query with SQLAlchemy?

https://github.com/mts-ai/FastAPI-JSONAPI/blob/main/fastapi_jsonapi/views/utils.py#L154

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant