java - How to validate JSON object? -
i validate incoming json object correctness @ server side. there standard / optimal way that? approach of validation?
my advice - deserialize json , see if breaks. example, if you're using c# on server side, can use newfangled datacontractjsonserializer
, or old way javascriptserializer
arguably simpler.
var serializer = new javascriptserializer(); var result = serializer.deserialize<dictionary<string, object>>(jsonstring);
edit: , it's come out you're using java, of course c# example not going work you, concept same. stackoverflow has answers here: convert json string object in java me?
Comments
Post a Comment