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