You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The job of django-rest-framework-xml is to convert dictionaries to xml. It is valid for a python dictionary to contain a key which is either an integer or the string representation of an integer. And it renders find to json. But the xml renderer fails: (i) if the key is an integer, sax will raise an exception; (2) if it's a string rep of an integer, it will render to invalid xml because an xml tag name cannot be a number.
I propose we slightly modify the renderer's _to_xml method to add this code when iterating each key:
The job of django-rest-framework-xml is to convert dictionaries to xml. It is valid for a python dictionary to contain a key which is either an integer or the string representation of an integer. And it renders find to json. But the xml renderer fails: (i) if the key is an integer, sax will raise an exception; (2) if it's a string rep of an integer, it will render to invalid xml because an xml tag name cannot be a number.
I propose we slightly modify the renderer's _to_xml method to add this code when iterating each key:
Does that seem reasonable?
The text was updated successfully, but these errors were encountered: