Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Since we are outputting entities with UUIDs as the main JSON API identifier, we also need to support denormalizing payloads that contain UUIDs into entity classes.
Proposed resolution
Check the configuration for the ID key and use that to load the entity while deserializing in the RequestHandle.
Comment | File | Size | Author |
---|---|---|---|
#25 | 2759707--support-denormalization-with-uuid--25.patch | 30.83 KB | e0ipso |
Comments
Comment #2
dawehnerWorking on it
Comment #3
dawehnerNeeded to stop, will continue later. Maybe we though better patch core to support UUIDs in its entity_reference_item
Comment #4
e0ipso#2790257: [FEATURE] Allow upserting entities with UUID references is a duplicate of this one.
Comment #5
e0ipsoComment #6
e0ipsoStealing this from @dawehner.
Comment #7
e0ipsoAdded failing patch.
Comment #8
e0ipsoAdded fixing patch.
Even if this comes green we need error handling for situations where the user inputs unexisting UUIDs.
Comment #15
e0ipsoForgotten annotation in abstract class.
Comment #16
e0ipsoSince I made it an abstract class, I should remove the group annotation.
Comment #21
e0ipsoFixed other tests.
Comment #22
e0ipsoComment #25
e0ipsoThis completes this ticket by testing error cases.
Comment #27
dawehnerThis looks like a great feature and implementation, filters, maps etc. :)
Conceptually it'd be great to document this entire new code.
I really like using strtok for this specific usecase
Comment #28
e0ipso@dawehner thank you for the review.
Do you mean inline code documentation or more like drupal.org/documentation docs?