Problem/Motivation

Denormalize a collection is useful when posting a collection for updating multiple entities at once.

It depends on #2100637: REST views: add special handling for collections

Proposed resolution

Do it.

Remaining tasks

User interface changes

API changes

Comments

Wim Leers’s picture

Title: Implement denormalization once normalization has settled » Implement collection denormalization
Version: 8.0.x-dev » 8.1.x-dev
Wim Leers’s picture

Title: Implement collection denormalization » [PP-1] Implement collection denormalization

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Grayside’s picture

In practice, Collection Denormalization a.k.a. Batch Creation/Update is kind of a pain. I have heard more stories of people removing support after being happy to implement it than stories of people implementing it.

  • That many write operations can have payload size & caching implications.
  • It is difficult to manage feedback of individual operations when individual entities can fail, often for different reasons, placing a lot of burden on sophisticated clients to sort it out.
  • It's kind of an edge case optimization

For those reasons, I think it makes more sense to build out in contrib and measure usage rather than support it in core.

Some of the complexities can be seen in RFC 6587 (WebDav) which scrolling down to section 3.8 shows you HTTP 207 Multi-Status as a clue for the kinds of hijinks you need to simulate support for clear, HTTP-centric communication about the batch results, and that's without the client-side.

Wim Leers’s picture

Wow, https://tools.ietf.org/html/rfc6578#section-3.8 is indeed frightening!

I still need to do some reading & research to better understand this feature and what it entails exactly. In my mind, this was just about being able to GET collections, not about being able to POST/PATCH/DELETE collections. Collection GET support is for sure the 90% use case.

Wim Leers’s picture

e0ipso’s picture

Collection GET support is for sure the 90% use case.

That is very true. I think that a solution on this (provided there's technical viability) would be a good DX just as inline entity forms are a good admin experience.

It's kind of an edge case optimization

I also agree with this. So, I'm unsure how much we need this.

I will keep the JSON API issue postponed until new arguments in favor are provided.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Wim Leers’s picture

Title: [PP-1] Implement collection denormalization » [PP-1] Collection denormalization
Category: Bug report » Feature request

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Wim Leers’s picture

Status: Postponed » Closed (works as designed)
Issue tags: +API-First Initiative
Related issues: +#2843147: Add JSON:API to core as a stable module

2.5 years later, nothing has happened.

Since then, Drupal 8.7.0 has been shipping for 6 months with the JSON:API module which does support collections. It does not yet support bulk/batch creation. But that's being worked on for a future version of the JSON:API spec: https://github.com/json-api/json-api/issues/795.