...
"stuff" : {
"arbitrary_key_1" : {"some":"stuff"},
"arbitrary_key_2" : {"some":"stuff"},
"other_key_3" : {"some":"stuff"}
}
...
If your keys are arbitrary then you should use additionalProperties:
{
"type": "object",
"additionalProperties:" {
"schema": "for",
"values": "here"
}
}
--
Francis Galiegue, fgal...@gmail.com
"It seems obvious [...] that at least some 'business intelligence'
tools invest so much intelligence on the business side that they have
nothing left for generating SQL queries" (Stéphane Faroult, in "The
Art of SQL", ISBN 0-596-00894-5)
"definitions"
: {
"type"
:
"object"
,
"additionalProperties"
: {
"type"
:
"object"
,
"additionalProperties"
: {
"enabled"
: {
"type"
:
"boolean"
,
"required"
:
true
},
"address"
: {
"type"
:
"string"
,
"required"
:
true
}
}
}
}
that could model the following:
That was meant to be literal :) "schema for values here". Sorry for
the confusion!
> This is what I gathered from some other posts which may or may not be syntactically correct:
>
> "definitions" : {
> "type" : "object",
> "additionalProperties" : {
> "type" : "object",
> "additionalProperties" : {
> "enabled" : {
> "type" : "boolean",
> "required" : true
> },
> "address" : {
> "type" : "string",
> "required" : true
> }
> }
> }
> }
>
Your second "additionalProperties" should in fact be "properties".
Inside the "additionalProperties" of the "defintions" keys, it should
read:
{
"type" : "object",
"additionalProperties" : {
"type" : "object",
"properties" : {
"enabled" : {
"type" : "boolean",
"required" : true
},
"address" : {
"type" : "string",
"required" : true
}
},
"additionalProperties": false
}
}
Note the inner additionalProperties defined to false: this disallows
the presence of properties other than "enabled" or "address".