/**
* Injects the specific root node ID if "@local-tree-root" was specified
*
* @param Request $request
*
* @return mixed
*
* @throws RuntimeException
* @throws PartLimitExceededException
*/
public function __invoke(Request $request)
{
/**
* @var $resourceType ResourceInterface
*/
if ($this->partService->checkPartLimit()) {
throw new PartLimitExceededException();
}
list($resourceType, $format) = $this->extractAttributes($request);
return $this->serializer->deserialize($request->getContent(), $resourceType->getEntityClass(), $format, $resourceType->getDenormalizationContext());
}