Skip to content

Sparse Fieldsets exclusion implentation #91

Closed
@RandyRomero

Description

@RandyRomero

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions