Convert object to schema