/**
* Convert the given $source to $targetType depending on the MediaTypeConverterInterface::CONFIGURATION_MEDIA_TYPE property mapping configuration
*
* @param string $source the raw request body
* @param string $targetType must be "array"
* @param array $convertedChildProperties
* @param PropertyMappingConfigurationInterface $configuration
* @return array
* @api
*/
public function convertFrom($source, $targetType, array $convertedChildProperties = [], PropertyMappingConfigurationInterface $configuration = null)
{
$mediaType = null;
if ($configuration !== null) {
$mediaType = $configuration->getConfigurationValue(MediaTypeConverterInterface::class, MediaTypeConverterInterface::CONFIGURATION_MEDIA_TYPE);
}
if ($mediaType === null) {
$mediaType = MediaTypeConverterInterface::DEFAULT_MEDIA_TYPE;
}
return $this->convertMediaType($source, $mediaType);
}