Skip to content

msrest deserialization doesn't read object-typed attributes when xml namespace is present #11568

@YijunXieMS

Description

@YijunXieMS
  • Package Name: msrest
  • Package Version:
  • Operating System: Windows
  • Python Version: 3.7

Describe the bug
object-typed attributes is None when deserializing an xml with a namespace into a Model object

To Reproduce
Steps to reproduce the behavior:
Run the following code that serialize and then deserialize to restore the object. "author" becomes None. Debugging shows that the serialized xml has author tag, so problem should be with the deserialization.

dr = QueueDescriptionResponse(
    id="test id",
    published="test published",
    author=QueueDescriptionResponseAuthor(name="testname"),
    link=QueueDescriptionResponseLink(href="test href"),
    content=QueueDescriptionResponseContent()
)
s = ElementTree.tostring(dr.serialize(is_xml=True)).decode("utf-8")
print(s)
restored_object = QueueDescriptionResponse.deserialize(s, content_type="application/xml")
print(restored_object)

Model classes are here.
models.zip

Expected behavior
The restored object should have "author"

Metadata

Metadata

Assignees

Labels

Autorest IssueClientThis issue points to a problem in the data-plane of the library.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions