Add option to handle json wrapped in array

Created on 9 September 2018, over 6 years ago
Updated 3 June 2024, 7 months ago

According to the external_entities documentation, views cannot be used

However we have included a patch in this issue so that in fact yes, views CAN be used.

There are some questions remaining regarding page and limit_per_page:
see 📌 indexing external entities - tracking locks up Needs review

The patch below is required in order to follow the design pattern that was demonstrated at Drupal Europe 5 years ago. Described by these two docuements:
https://www.drupaleurope.org/session/how-cope-external-entities.html
https://www.drupaleurope.org/sites/default/files/slides/2018-09/How%20to...
https://youtu.be/tHGc6AdLzs4

Prior to this patch:

unable to process external entity lookup using the described configuration
(this is maybe unrelated?)

With patch 8 applied, an array option is added


With option "Response for single item is wrapped in array" enabled, external_entities rest endpoint can now be a json generated by "views" from Drupal core as described in the links above.
1) Fixes external entities processing
Maybe unrelated?

Original background information

The response from a Drupal 8 Views REST Export display for a single item is wrapped in an array. The new support for mapped data does not help because the mapping is different for a single item than multiple items.

One solution would be to create a Drupal Views REST storage client but it would be very similar to the basic REST client, and presumably would need to be in another module. Another approach would be to extend the decoders but that seems like a lots of new code for a small issue.

The patch here adds a checkbox to the REST storage client form to indicate that the array wrapper will be removed from the response.

Feature request
Status

Needs review

Component

Code

Created by

🇬🇧United Kingdom polynya

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.

Production build 0.71.5 2024