Skip to content

Conversation

@mohsinm-dev
Copy link

Summary

  • Adds support for modern dict[str, str] syntax in ApiClient.__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.sh to apply patch during client generation
  • Added comprehensive unit tests covering both syntaxes and nested dicts

Test plan

  • Unit test test_deserialize_dict_syntax_compatibility passes
  • Legacy dict(str, str) syntax continues to work
  • New dict[str, str] syntax works correctly
  • Nested dict[str, dict[str, str]] syntax works
  • No breaking changes to existing functionality

Fixes #2463

…upport)

Adds post-gen patch; aligns with list[...] and pydantic adapters; no behavior change for legacy types.

Fixes kubernetes-client#2463
@k8s-ci-robot
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Nov 1, 2025
@k8s-ci-robot
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Nov 1, 2025
@k8s-ci-robot k8s-ci-robot requested a review from roycaihw November 1, 2025 11:55
@k8s-ci-robot
Copy link
Contributor

[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.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot requested a review from yliaog November 1, 2025 11:55
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/invalid-commit-message Indicates that a PR should not merge because it has an invalid commit message. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect type declaration in openapi_types for dict

2 participants