@@ -644,7 +644,7 @@ def todict(obj, post_processor=None):
644644 """
645645 from datetime import date , time , datetime , timedelta
646646 from enum import Enum
647- from azure .core .serialization import attribute_list
647+ from azure .core .serialization import attribute_list , get_backcompat_attr_name
648648 if isinstance (obj , dict ):
649649 result = {k : todict (v , post_processor ) for (k , v ) in obj .items ()}
650650 return post_processor (obj , result ) if post_processor else result
@@ -662,7 +662,8 @@ def todict(obj, post_processor=None):
662662 # azure-core provided new function `attribute_list` to list all attribute names
663663 # so that we don't need to use raw __dict__ directly
664664 if getattr (obj , "_is_model" , False ):
665- result = {to_camel_case (attr ): todict (getattr (obj , attr ), post_processor )
665+ x = attribute_list (obj )
666+ result = {to_camel_case (get_backcompat_attr_name (obj , attr )): todict (getattr (obj , attr ), post_processor )
666667 for attr in attribute_list (obj ) if hasattr (obj , attr )}
667668 return post_processor (obj , result ) if post_processor else result
668669 if hasattr (obj , '_asdict' ):
0 commit comments