This project has moved. For the latest updates, please go here.

Telling JSON to default to null if datatype does not match.

Sep 12, 2010 at 9:12 PM
Edited Sep 13, 2010 at 9:40 PM

Is that possible? 

If I have a JSON string that looks like:


and a class that looks like

foo() {

public a {get;set;} 

public b {get;set;}



but sometimes foo is 

Is there a way to tell the deserializer to set my foo instance to NULL if the json string is of type array?