Skip to content

Commit 7f48307

Browse files
committed
allow @id, @context and @type
1 parent c7f25dc commit 7f48307

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Serializer/AbstractItemNormalizer.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@ protected function getAllowedAttributes(string|object $classOrObject, array $con
426426
$propertyNames = $this->propertyNameCollectionFactory->create($resourceClass, $options);
427427

428428
$allowedAttributes = [];
429+
if ($context['api_denormalize'] ?? false) {
430+
$allowedAttributes = ['@id', '@type', '@context'];
431+
}
429432
foreach ($propertyNames as $propertyName) {
430433
$propertyMetadata = $this->propertyMetadataFactory->create($resourceClass, $propertyName, $options);
431434

0 commit comments

Comments
 (0)