-
-
Notifications
You must be signed in to change notification settings - Fork 942
Open
Description
API Platform version(s) affected: 4.2
It's quite annoying not to be able to disable automatic mapping we should move this logic:
$request = $context['request'] ?? null;
$entityClass = null;
if (($options = $operation->getStateOptions()) && $options instanceof Options && $options->getEntityClass()) {
$entityClass = $options->getEntityClass();
}
if (($options = $operation->getStateOptions()) && $options instanceof OdmOptions && $options->getDocumentClass()) {
$entityClass = $options->getDocumentClass();
}
// Look for Mapping metadata
if ($this->objectMapperMetadata) {
if (!$this->canBeMapped($operation->getClass()) && (!$entityClass || !$this->canBeMapped($entityClass))) {
return $data;
}
} elseif (!(new \ReflectionClass($operation->getClass()))->getAttributes(Map::class) && !(new \ReflectionClass($entityClass))->getAttributes(Map::class)) {
return $data;
}
To an operation flag inside a metadata factory and check this flag.
GaryPEGEOT
Metadata
Metadata
Assignees
Labels
No labels