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

Class Attributes: Influence the json document/schema validation/creation

Oct 15, 2009 at 5:48 AM
Edited Oct 15, 2009 at 5:49 AM

I typically use the like this

  1. Define a C# class
  2. Create the schema of that class using
  3. Interact with the json doc file by using serialize and deserialize functionality.
  4. Use the schema to validate the json document


  • Can we annotate the c# class to influence the schema/json document? 
  • Do we need to have the schema ? Can we have the class definition with the attributes/annotation do the json document validation?
  • Is there a example to show proper way of validations? usage?


Oct 18, 2009 at 2:42 AM

There is IsRequired on the JsonProperty attribute which is checked during deserialization.