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
/**
* @author Adrien Brault <[email protected]>
*/
class JsonHalSerializer implements JsonSerializerInterface
{
/**
* {@inheritdoc}
*/
public function serializeLinks(array $links, JsonSerializationVisitor $visitor, SerializationContext $context)
{
...........
$visitor->addData('_links', $serializedLinks);
}
/**
* {@inheritdoc}
*/
public function serializeEmbeddeds(array $embeddeds, JsonSerializationVisitor $visitor, SerializationContext $context)
{
........
$visitor->addData('_embedded', $serializedEmbeddeds);
}
}
In my project I wanted to customize '_link' and 'embedd' key words. One solution is to extend JsonHalSerializer to a custom serializer and then use the setJsonSerializer method. Is there any other simpler way to do this without overriding JsonHalSerializer.
The text was updated successfully, but these errors were encountered:
In my project I wanted to customize '_link' and 'embedd' key words. One solution is to extend
JsonHalSerializer
to a custom serializer and then use thesetJsonSerializer
method. Is there any other simpler way to do this without overriding JsonHalSerializer.The text was updated successfully, but these errors were encountered: