protected function DataDefinitionUndefinedNormalizer::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/ DataDefinitionUndefinedNormalizer.php, line 20
Class
- DataDefinitionUndefinedNormalizer
- Data definition normalizer.
Namespace
Drupal\jsonapi_schema\NormalizerCode
protected function extractPropertyData(DataDefinitionInterface $property, array $context = []) {
return isset($context['name']) ? (object) [
'title' => $context['name'],
] : (object) [];
}