Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
YijunXieMS opened this issue May 20, 2020 · 1 comment
Assignees
Labels
Autorest Issue Client This issue points to a problem in the data-plane of the library.
Milestone

Comments

@YijunXieMS
Copy link
Contributor

  • 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"

@YijunXieMS YijunXieMS added Autorest Issue Client This issue points to a problem in the data-plane of the library. labels May 20, 2020
@YijunXieMS YijunXieMS added this to the [2020] June milestone May 20, 2020
@lmazuel
Copy link
Member

lmazuel commented Jun 5, 2020

Released part of msrest 0.6.15

@lmazuel lmazuel closed this as completed Jun 5, 2020
openapi-sdkautomation bot pushed a commit to AzureSDKAutomation/azure-sdk-for-python that referenced this issue Nov 11, 2020
Added cloud service NIC and PIP APIs specifications (Azure#11568)

* Added cloud service NIC and PIP APIs specifications

* Moved new APIs to 2020-07-01 version

* Updated version to 2020-07-01 in json files

* Updated api version tp 2020-07-01 in examples

Co-authored-by: Richa Jain <ricjain@microsoft.com>
@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Autorest Issue Client This issue points to a problem in the data-plane of the library.
Projects
None yet
Development

No branches or pull requests

2 participants