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

Popular posts from this blog

linux - Mailx and Gmail nss config dir -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -