I think there's a corresponding issue on the XML side of things.
I remember having seen such an issue for XML as well but as code handling enums is not shared between XML and CPA I will only address the CPA side.
Final patch
I think there's a corresponding issue on the XML side of things.