As far as I can understand JSON, and the schema draft, your example
won't work because JSON itself will not allow anything else than
strings as keys, so your best bet here would be to define two schemas:
* one array schema for the [key, value] type, which is a two-members-
only array, the first member being the key and the second member being
the value (unlike for objects, array members _are_ ordered);
* another array schema with only items defined, with maxItems.
So: (with comments, note that comments in JSON are _illegal_, or at
least not defined enough so that they are safe):
----
{
"type": "array",
"maxItems": 125,
"items": {
"type": "array",
"items": [
{ // key schema goes here },
{ // value schema goes here }
],
"additionalItems": false
}
}
----
Two notes:
* the inner schema does item tuple validation - element 0 must match
schema 0 (the key), element 1 must match schema 1 (the value) - this
is because the "items" value is an array;
* the inner schema specifies additionalItems to be FALSE, which means
the array specified MUST have only these two elements;
* in the outer schema, the value of items is an object: this means the
only constraint is that elements in the array match the specified
schema, there is no (lower or upper) limit as to the number of items;
if you want items in the array to be unique, you may want to add
"uniqueItems": true as well.
<ad>My current JSON schema implementation will be able to validate
this as long as it doesn't do $ref, so please try it an report
bugs :p</ad>