implement oneOf for objects