There's also JSONSchema (http://json-schema.org/), which is significantly more verbose, but has optionals, string length constraints and other sort of quite useful stuff.
And there is (or, better say, was) an "Orderly JSON" language that had nice and compact human-manageable representations, but had essentially died from nobody using it.
JSchema:
{
"name": "@string",
"age": "@int"
}
Pros: is JSON, is simple to read and write. Cons: is (currently) limited to very primitive schemas.JSONSchema:
{
"type": "object",
"properties": {
"name": {"type": "string"},
"age": {"type": "integer", "minimum": 0, "description": "Age in years"}
},
"required": ["name"]
}
Pros: is JSON and reasonably powerful. Seems to be a most common standard out there, with lots of libraries available. Cons: is verbose to the extent it's no fun to read or write by hand. Has some ambiguities and - as the OP article correctly says - spec is unfinished.Orderly JSON:
object {
string name;
integer {0,} age?;
};
Pros: compact and powerful. Cons: not JSON but a custom grammar, no one uses it.