You are here

protected function DataDefinitionStringNormalizer::extractPropertyData in JSON:API Schema 8

Extracts property details from a data definition.

This method includes mapping primitive types in Drupal to JSON Schema type and format descriptions. This method is invoked by several of the normalizers.

Parameters

\Drupal\Core\TypedData\DataDefinitionInterface $property: The data definition from which to extract values.

array $context: Serializer context.

Return value

array Discrete values of the property definition

Overrides DataDefinitionNormalizer::extractPropertyData

File

src/Normalizer/DataDefinitionStringNormalizer.php, line 20

Class

DataDefinitionStringNormalizer
Data definition normalizer.

Namespace

Drupal\jsonapi_schema\Normalizer

Code

protected function extractPropertyData(DataDefinitionInterface $property, array $context = []) {
  $value = parent::extractPropertyData($property);
  $value['type'] = 'string';
  return $value;
}