Just use a JSON reference to point back to the schema itself:
{
"type": "object",
"required": [ "id" ],
"properties": {
"id": {
"type": "string",
"description": "The node id"
},
"children": {
"type": "array",
"items": { "$ref": "#" }
}
}
}
The #
JSON reference means in essence "the document itself". This therefore allows you to define recursive schemas, as here.
Note: rewritten so that it conforms to draft v4.