generator: handle cases for hash keys with deprecated flags and duplicate names