I have been using JSON.Serialize method extensively in one of customer's project. Today salesforce has started rolling out Spring '13 release on sandboxes. My customer's sandbox( cs11) is not listed onhttps://trust.salesforce.com/trust/maintenance/ but still Spring '13 is available in this sandbox.
I have noticed a change that if I serialize a sObject, Json Serializer doesn't return fields with null value in json. Before Spring '13 release it was working fine.
If this was a needed change to reduce size of serialized json, Salesforce should have made this version specific change or a overloaded method to keep backward compatibility. It has broken 30%-40% of my code that I will need to rewrite.
Salesforce please undo this change.
Current output: [ { "attributes": { "type": "ABC_c", "url": "/services/data/v27.0/sobjects/ABC_c/xxxx" }, "Active__c": false, "Id": "XXXX", "Name": "ABC" }, ]
Old output: [ { "attributes": { "type": "ABC_c", "url": "/services/data/v27.0/sobjects/ABC_c/xxxx" }, "Active_c": false, "FirstName_c": null, "Id": "XXXX", "Name": "ABC" }, ]