JSON:API recently implemented #3022584: Consolidate and simplify NormalizerValue objects: introduce CacheableNormalization → . Right now, the major issue with the whole serialization system is that it doesn't return the cacheablity metadata. Any external app which wants to relay on Drupal cacheablity metadata to cache the response on the client side cannot do it, if one want to expose the cacheablity metadata. Even in Drupal to cache the response JSON:API has to jump so many hoops see the patch committed in #3022584: Consolidate and simplify NormalizerValue objects: introduce CacheableNormalization → .
Introduce new CacheableNormalization
domain object so that every Normalizer can return the cacheablity metadata and entities can bubble appropriate cacheablity metadata.
Something like
class CacheableNormalization implements CacheableDependencyInterface {
use CacheableDependencyTrait;
/**
* A normalized value.
*
* @var mixed
*/
protected $normalization;
To preseve the BC just like $return_as_object
in \Drupal\Core\Access\AccessibleInterface::access($operation, AccountInterface $account = NULL, $return_as_object = FALSE)
$context['return_as_object']
can be used in \Symfony\Component\Serializer\Normalizer\NormalizerInterface::normalize($object, $format = null, array $context = array())
to return CacheableNormalization
object.
OR
CacheableNormalization
can implement __toString
or ArrayAccess
to only return Normalized value.
None
Hopefully, none.
TBD
TBD
Active
11.0 🔥
serialization.module
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.