Support dict[...] syntax in ApiClient.__deserialize
Summary
- Adds support for modern
dict[str, str]syntax inApiClient.__deserialize() - Maintains backward compatibility with existing
dict(str, str)syntax - Enables Pydantic adapter compatibility for
openapi_types
Changes
- Added post-generation patch
scripts/api_client_dict_syntax.diff - Updated
scripts/update-client.shto apply patch during client generation - Added comprehensive unit tests covering both syntaxes and nested dicts
Test plan
- [x] Unit test
test_deserialize_dict_syntax_compatibilitypasses - [x] Legacy
dict(str, str)syntax continues to work - [x] New
dict[str, str]syntax works correctly - [x] Nested
dict[str, dict[str, str]]syntax works - [x] No breaking changes to existing functionality
Fixes #2463
Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
Keywords which can automatically close issues and at(@) or hashtag(#) mentions are not allowed in commit messages.
The list of commits with invalid commit messages:
- 1a3a022 client: accept dict[...] in ApiClient.__deserialize (keep dict(...) support)
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.
[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: mohsinm-dev Once this PR has been reviewed and has the lgtm label, please assign yliaog for approval. For more information see the Code Review Process.
The full list of commands accepted by this bot can be found here.
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment