-
-
Notifications
You must be signed in to change notification settings - Fork 585
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 it possible to achieve something like - shouldSerializeEmpty #725
Comments
What about using virtual properties, and using them to normalise data?
…On 10 Mar 2017 13:45, "blueeyez" ***@***.***> wrote:
I'm having a hard time to serialize some complex data because some
relations are 0/1 -> n or vice-versa and the field itself was set in the
database as a blank space or empty, and in some cases NULL.
For these being said, I can't make the best use of setSerializeNull.
Is there any work around to achieve something like that in the
GenericSerializationVisitor for the visitArray method to add extra check?
Thank you!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#725>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAvaJy5e_a8rkO2VsPHE5VO5zAoAq9jeks5rkUXmgaJpZM4MZWFI>
.
|
So, I guess there's no other option beside that? Thanks! |
you can use a custom exclusion strategy. https://github.com/schmittjoh/serializer/blob/master/src/JMS/Serializer/Exclusion/ExclusionStrategyInterface.php and http://jmsyst.com/libs/serializer/master/cookbook/exclusion_strategies this should work well if you want to do it globally |
I'm having a hard time to serialize some complex data because some relations are 0/1 -> n or vice-versa and the field itself was set in the database as a blank space or empty, and in some cases NULL.
For these being said, I can't make the best use of setSerializeNull.
Is there any work around to achieve something like that in the GenericSerializationVisitor for the visitArray method to add extra check?
Thank you!
The text was updated successfully, but these errors were encountered: