Skip to content

[http-client-python] Add XML deserialization tests for EnumerationResults payload#9778

Merged
msyyc merged 13 commits intomainfrom
copilot/add-xml-deserialization-test
Mar 6, 2026
Merged

[http-client-python] Add XML deserialization tests for EnumerationResults payload#9778
msyyc merged 13 commits intomainfrom
copilot/add-xml-deserialization-test

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

  • Add test_enumeration_results — original flat-list payload test
  • Add test_enumeration_results_nested_empty_list — nested model with itemsName-wrapped empty list
  • Add test_enumeration_results_azure_sdk_pattern — Azure SDK model pattern with two unwrapped list fields
  • Add test_enumeration_results_blobs_unwrapped — documents unwrapped=True behavior on model-typed field
  • Fix pylint too-many-instance-attributes on _RestField — move the disable annotation outside the has_padded_model_property conditional so it is always emitted (11 attributes now unconditionally)
  • All 35 tests pass
Original prompt

This section details on the original issue you should resolve

<issue_title>[http-client-python] model base deserialization</issue_title>
<issue_description>Can we add a new test for deserializing the following xml payload:

<?xml version="1.0" encoding="utf-8"?><EnumerationResults ServiceEndpoint="https://service.blob.core.windows.net/" ContainerName="acontainer108f32e8"><Delimiter>/</Delimiter><Blobs /><NextMarker /></EnumerationResults></issue_description>

<agent_instructions>to the http-client-python package</agent_instructions>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…nResults payload

Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service bot added the emitter:client:python Issue for the Python client emitter: @typespec/http-client-python label Feb 23, 2026
Copilot AI changed the title [WIP] Add test for xml payload deserialization [http-client-python] Add XML deserialization test for EnumerationResults payload Feb 23, 2026
Copilot AI requested a review from l0lawrence February 23, 2026 22:35
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 24, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/http-client-python@9778

commit: 4b49fb5

…est for EnumerationResults

Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
Copilot AI changed the title [http-client-python] Add XML deserialization test for EnumerationResults payload [http-client-python] Add XML deserialization tests for EnumerationResults payload Feb 24, 2026
…ML deserialization tests

Co-authored-by: l0lawrence <100643745+l0lawrence@users.noreply.github.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

@typespec/http-client-python - fix ✏️

Return empty list instead of None for non-optional unwrapped XML list fields during deserialization

@typespec/http-client-python - internal ✏️

Add unit test for deserializing Azure Blob Storage EnumerationResults XML payload with attributes, empty list element, and empty string element.

msyyc and others added 2 commits March 4, 2026 13:43
Add _is_optional flag to _RestField, set during annotation parsing.
Use it in the unwrapped XML deserialization path to return [] for
list[X] fields instead of None when no matching children exist.
Optional[list[X]] fields correctly remain None.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
msyyc and others added 3 commits March 4, 2026 13:55
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@msyyc msyyc marked this pull request as ready for review March 4, 2026 06:00
@msyyc msyyc requested a review from iscai-msft as a code owner March 4, 2026 06:00
@msyyc msyyc force-pushed the copilot/add-xml-deserialization-test branch from 58c2ec2 to f35c087 Compare March 4, 2026 06:08
@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

…ance-attributes on _RestField

Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
@msyyc msyyc added this pull request to the merge queue Mar 6, 2026
Merged via the queue into main with commit 5bcb2af Mar 6, 2026
26 checks passed
@msyyc msyyc deleted the copilot/add-xml-deserialization-test branch March 6, 2026 04:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:client:python Issue for the Python client emitter: @typespec/http-client-python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[http-client-python] model base deserialization

5 participants