I have a json document in which a part can be either null or a subobject, like this:
[{ \"owner\":null }, { \"owner\":{ \"id\":1 } }]
What you've posted should work, if you remove the "type":"object" from the definition.
"type":"object"
However, a neater, more explicit way to specify alternatives is to use oneOf. You can keep your "id" definition untouched, and just use:
oneOf
"id"
"owner":{ "oneOf": [ {"type": "null"}, {"$ref":"#/definitions/id"} ] }