Fix logic of POST schema reference creation