Skip to content
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

serialize_null configuration #77

Closed
AAtticus opened this issue Apr 8, 2013 · 5 comments
Closed

serialize_null configuration #77

AAtticus opened this issue Apr 8, 2013 · 5 comments

Comments

@AAtticus
Copy link

AAtticus commented Apr 8, 2013

To be able to work with Knockout.js I require the keys of empty values to be preserved.
I thought this was added to a previous version of JMSSerializerBundle / Serializer but in the current version I can't find anything to make sure it also serializes null values.

Any suggestions?

(note: not sure if this should be posted in JMSSerializeBundle or here)

@stof
Copy link
Contributor

stof commented Apr 12, 2013

@schmittjoh
Copy link
Owner

Please ask question on the mailing list, or Stack Overflow. Thanks!

@geshan
Copy link

geshan commented May 28, 2013

Is there a question for it already on stack overflow or mailing list? any link? I'm facing a similar issue?

@Fraktl
Copy link

Fraktl commented May 28, 2013

I can't find a solution for this anywhere.
Something like this should either be included in the documentation or easily configurable in the extension settings.

@davidspiess
Copy link

Here is an example

use JMS\Serializer\SerializationContext;

$serializationContext = SerializationContext::create()->setSerializeNull(true);
$serializer->serialize($object, $format, $serializationContext);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants