-
Notifications
You must be signed in to change notification settings - Fork 333
[python] support enum type for array encode #9407
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
Conversation
Co-authored-by: msyyc <70930885+msyyc@users.noreply.github.com>
commit: |
|
All changed packages have been documented.
|
…m/microsoft/typespec into copilot/add-test-case-http-client
…ilot/add-test-case-http-client
|
You can try these changes here
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for enum types in array encoding for the Python HTTP client generator. It addresses issues #9404 and #9026 by updating the deserialization logic to handle delimited arrays containing enum and extensible enum values.
Changes:
- Updated
@typespec/http-specsdependency from0.1.0-alpha.31to0.1.0-alpha.32-dev.1to include new test specifications - Added comprehensive test coverage for enum and extensible enum array encoding with various delimiters (comma, space, pipe, newline)
- Refactored
_deserialize_sequencelogic in model_base.py.jinja2 to support union types containing array-encoded deserializers
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/http-client-python/package.json | Updates http-specs dependency to version with enum array test cases |
| packages/http-client-python/package-lock.json | Updates lockfile with new http-specs version and dependency ranges |
| packages/http-client-python/generator/test/generic_mock_api_tests/test_encode_array.py | Adds 8 new test cases for enum and extensible enum array encoding |
| packages/http-client-python/generator/test/generic_mock_api_tests/asynctests/test_encode_array_async.py | Adds async versions of the 8 new enum array encoding test cases |
| packages/http-client-python/generator/pygen/codegen/templates/model_base.py.jinja2 | Refactors deserialization logic to support enum arrays in union types and removes bare except clause |
| .chronus/changes/copilot-add-test-case-http-client-2026-0-19-7-35-17.md | Documents the feature addition in changelog |
Files not reviewed (1)
- packages/http-client-python/package-lock.json: Language not supported
fix #9404
fix #9026