Compatibility with jsonapi_include

Created on 25 January 2023, over 2 years ago

Problem/Motivation

I use this (fantastic) module along with JSONAPI Include β†’ . After updating to the latest (1.6) version of that module, the structure of the JSON from this module changes.

Steps to reproduce

  1. Install JSONAPI Include 1.6 or higher.
  2. Browse to a JSON response from this module eg /jsonapi/menu_items/main
  3. Note that the structure of the menu_link_content has changed with most of the data moving up a level from being children of the 'attributes' property.

Note that JSONAPI Include already affected the structure of /jsonapi/menu_link_content/menu_link_content provided by core in the same way in previous versions. The latest update also makes it affect this modules output.

Proposed resolution

I don't think this is a bug, but it is a gotcha. Posting for exposure for others who use both modules and may be trying to workout why the data structure changed suddenly.

πŸ“Œ Task
Status

Active

Version

1.2

Component

Miscellaneous

Created by

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

Comments & Activities

  • Issue created by @cb_dewr
  • Status changed to Closed: works as designed 3 months ago
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    I think this is the jsonapi_include module working as designed. If you don't want that module to do this you need to configure it differently. You can configure it so that it only affects reponses with include jsonapi_include=1 as a query param. See that module's documentation - https://www.drupal.org/project/jsonapi_include β†’

Production build 0.71.5 2024