-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there any way to override keys _links & _embedded in the JsonHalSerializer #175
Labels
Comments
I don't see any other way. The library could split the serializeLinks and serializeEmbeddeds methods and introduce protected methods: class JsonHalSerializer
{
public function serializeLinks(...)
{
$visitor->addData('_links', $this->getLinks());
}
public function serializeEmbeddeds(...)
{
$visitor->addData('_embedded', $this->getEmbedded());
}
protected function getLinks(){}
protected function getEmbedded(){}
} which would make extension easier |
@abhisheksavant What is your use case ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: