-
-
Notifications
You must be signed in to change notification settings - Fork 312
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
SerializeNull #440
Comments
My bad, seems that there was an error in my code due to the fact that the context cannot be reused. |
@theofidry Is there something more general? I have multiple controllers (>10) each witch multiple methods and would love to have the serializer do this by default without configuring it for each method directly! |
I'm sorry @lony it's been so long I don't remember it at all :( That being said now Symfony serializer 2.7 has been greatly improved there is not much interest to use JMSSerializerBundle anymore if you can use it. (and it's more performant too!) |
@theofidry thank you but so far I can not switch. I will try around :) |
Duplicate of this issue that has been closed although the problem has not been solved (I can't reopen the issue...)
So, the question is how to serialise null attributes? If an attribute has the null value, my serialised entity doesn't have the attribute. Is there a way to specify that we which to have this attribute with the value
null
in our serialised object?I found an interesting issue about that. It suggests to use the
SerialisationContext
:And indeed it works fine for some entities:
But when I check it on entities which some attributes are resolved with Doctrine, the problem is still there:
The text was updated successfully, but these errors were encountered: