jpadilla / django-rest-framework-xml

XML support for Django REST Framework

Home Page:http://jpadilla.github.io/django-rest-framework-xml

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Lists are improperly deserialized

mdear opened this issue · comments

I want to send as part of a REST API POST the following XML

<target_create_request>
<ready_for_dispatch>true</ready_for_dispatch>
{testbed_info: client_specific_testbed_info}
<callback_urls>http://jdoe-dev:8080/target_update</callback_urls>
<callback_urls>http://jdoe-dev:8081/target_update</callback_urls>
<max_retention_period_seconds>604800</max_retention_period_seconds>
<max_queued_items>150</max_queued_items>
</target_create_request>

This maps to the JSON, which has an ordered list for callback_urls:
{
"ready_for_dispatch": true,
"metadata": "{testbed_info: client_specific_testbed_info}",
"callback_urls": [
"http://jdoe-dev:8080/target_update",
"http://jdoe-dev:8081/target_update"
],
"max_retention_period_seconds": 604800,
"max_queued_items": 150
}

The issue : in my Django 1.10 view, callback_urls is deserialized as a string, not a list, and I only get the last item in the list.

I just saw a pull request dealing with this issue, so I'll close this ticket.