Updated in #80
Problem/Motivation
Let's say I have computed field with the string value which shows the current time of the request. Right now there is no way to set cachebality metadata for computed fields so jsonapi shows the time of serialization instead of current time in the response.
Proposed resolution
Proposal 1
Allow computed field item list class to provide cacheable metadata. Using CacheableDependencyTrait
. See JsonApiComputedFieldItemList
in #37.
Proposal 2
Allow PrimitiveDataNormalizer
to set the cacheable metadata. Using RefinableCacheableDependencyTrait
and PrimitiveDataNormalizer
should bubble it. See the patch in #75
Remaining tasks
Decide the approach.
User interface changes
None
API changes
API addition so that computed fields/properties can bubble the cacheable metadata.
Data model changes
Depends on the proposal