DataDefinitionEntityReferenceNormalizer.php in JSON:API Schema 8
File
src/Normalizer/DataDefinitionEntityReferenceNormalizer.php
View source
<?php
namespace Drupal\jsonapi_schema\Normalizer;
use Drupal\Core\TypedData\DataDefinitionInterface;
class DataDefinitionEntityReferenceNormalizer extends DataDefinitionNormalizer {
protected $supportedDataTypes = [
'entity_reference',
];
protected function extractPropertyData(DataDefinitionInterface $property, array $context = []) {
$value = parent::extractPropertyData($property);
$value['type'] = 'object';
return $value;
}
}