Json Model
Model Json is a simple declarative way of specifying models. The library converts the models in to json-schema.
Simple types
There are three types you dan can define in Json Model.
{
"var1" : "boolean",
"var2" : "integer",
"var3" : "string"
}
Optional types
Every field can be made optional by adding a question mark at the end.
{
"var1" : "string?"
}
Definitions
Definitions are used reuse sub models.
{
"var1" : "$def1",
"$def1" : {
"var2": "string"
}
}
Definitions optional
Definitions can also be used as optional
{
"var1" : "$def1?",
"$def1" : {
"var2": "string?"
}
}
Arrays
{
"arr1" : ["string"]
}
Arrays with Definitions
{
"arr1" : ["$def1"],
"$def1":{
"var1" : "string"
}
}