You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Include extended JsonLD data if DTO outputs original object
In `ApiPlatform\Core\DataTransformer\DataTransformerInterface` there is a comment that states that DTOs should be allowed to return the same original object if no transformation is done. This resulted in missing LD data. (No @id, @context etc.).
```php
/**
* Transforms the given object to something else, usually another object.
* This must return the original object if no transformation has been done.
*
* @param object $object
*
* @return object
*/
public function transform($object, string $to, array $context = []);
```
This update checks if the output class is the same as the original, and if so populated the extended metadata in the JsonLd\ItemNormalizer as it would not be added using the JsonLd\ObjectNormalizer
0 commit comments