I have a json document in which a part can be either null or a subobject, like this:
[{
"owner":null
},
{
"owner":{
"id":1
}
}]
The question is if its possible to model this in json schema draft v4 using ref?
What I would like is something like this
{
"type":"object",
"properties":{
"owner":{
"type":["null", "object"],
"$ref":"#/definitions/id"
}
},
"definitions":{
"id":{
"type":"object",
"properties":{
"id":{
"type":"number"
}
}
}
}
}