We are using Symfony2 FOSRestBundle with JMSSerializerBundle for developing REST APIs to be consumed by mobile developers.
The API response in JSON format returns 'null' as value of properties wherever applicable, which is generating an exception for the 3rd party library being used by mobile developers.
I don't see a solution from JMSSerializerBundle or FOSRestBundle to overwrite the value as per our requirement.
Workaround so far I can set default value in entity so that the fresh data will have some default value in database, instead of null. But this doesn't work for a one-to-one/many-to-one relationship objects, as those will return null by default instead of blank object.
Any solution to overwrite the json after serialization ?