Skip to content

[python] Fix XML deserialization for enum/datetime types and add mock API tests#9724

Open
Copilot wants to merge 7 commits intomainfrom
copilot/add-test-case-for-pull-9660
Open

[python] Fix XML deserialization for enum/datetime types and add mock API tests#9724
Copilot wants to merge 7 commits intomainfrom
copilot/add-test-case-for-pull-9660

Conversation

Copy link
Contributor

Copilot AI commented Feb 14, 2026

  • Ensure prerequisites are met (pnpm install, package build)
  • Identify the Spector case link (from PR Add XML model test cases for enum and datetime properties #9660: payload/xml ModelWithEnum and ModelWithDatetime)
  • Update @typespec/http-specs dependency to 0.1.0-alpha.33-dev.2 in packages/http-client-python/package.json
  • Regenerate the payload/xml generated client
  • Fix XML deserialization bug for enum (CaseInsensitiveEnumMeta) and datetime types in model_base.py.jinja2
  • Add None check for value.text before passing to _DESERIALIZE_MAPPING / _DESERIALIZE_MAPPING_WITHFORMAT callables
  • Implement sync tests in generic_mock_api_tests/test_payload_xml.py for ModelWithEnum and ModelWithDatetime
  • Implement async tests in generic_mock_api_tests/asynctests/test_payload_xml_async.py for ModelWithEnum and ModelWithDatetime
  • Format changed Python files with Black
  • Validate tests locally (all 15 sync + 15 async tests pass)
  • Add a changelog entry under .chronus/changes
  • Run code review (no issues found)
  • Run CodeQL security scan (no alerts)

Security Summary

No security vulnerabilities were introduced or discovered.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…n for enum/datetime types

Co-authored-by: msyyc <70930885+msyyc@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 14, 2026
Copilot AI changed the title [WIP] Add test case for Typespec pull request 9660 Fix XML deserialization for enum/datetime types and add mock API tests Feb 14, 2026
Copilot AI requested a review from msyyc February 14, 2026 06:09
@msyyc msyyc changed the title Fix XML deserialization for enum/datetime types and add mock API tests [python] Fix XML deserialization for enum/datetime types and add mock API tests Feb 14, 2026
@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 14, 2026

Open in StackBlitz

npm i https://pkg.pr.new/microsoft/typespec/@typespec/http@9724
npm i https://pkg.pr.new/microsoft/typespec/@typespec/http-client@9724

commit: a6d65b9

@github-actions
Copy link
Contributor

github-actions bot commented Feb 14, 2026

All changed packages have been documented.

  • @typespec/http-client-python
Show changes

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

Add mock API tests for XML model with enum and datetime properties, and fix XML deserialization for enum and datetime types

@azure-sdk
Copy link
Collaborator

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

…lables

Co-authored-by: annatisch <8689453+annatisch@users.noreply.github.com>
Co-authored-by: annatisch <8689453+annatisch@users.noreply.github.com>
Co-authored-by: annatisch <8689453+annatisch@users.noreply.github.com>
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.

4 participants