Serialization returns all fields

Created on 21 January 2022, over 3 years ago
Updated 4 April 2023, about 2 years ago

Problem/Motivation

When I goto the API endpoint for the View it seems like all of the content type's fields are returned.

For example, I don't have Body in the list of fields in the View but it still returns it. Ideally, it should only return the fields listed.

Steps to reproduce

1) Install the module
2) Go to a JSON:API Views endpoint and all the fields will be shown serialized

Proposed resolution

The module needs to filter the fields returned according the Drupal Views UI.

Remaining tasks

Code

User interface changes

None

API changes

The API shouldn't change, only the output.

Data model changes

No model changes.

πŸ› Bug report
Status

Closed: works as designed

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States pmagunia Philadelphia πŸ‡ΊπŸ‡Έ

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¦πŸ‡ΊAustralia rupertdance

    I'm also seeing this same behaviour? Selecting either Content OR Fields shows me the entirety of every node inside the JSON.. what am i missing here?

  • Status changed to Closed: works as designed about 2 years ago
  • πŸ‡ΊπŸ‡ΈUnited States pixelwhip

    This is unintuitive but by design, at least for now. JSON:API works on a resource basis, which returns all attributes and relationships by default. In order to limit the data returned, you need to use sparse fieldsets when making the api request.

Production build 0.71.5 2024