Skip to content

python api_client: fix type for reponse_type to deserialize(). - #25798

Open
mr-c wants to merge 1 commit into
OpenAPITools:masterfrom
mr-c:python-api-client-deserialize-typing
Open

mr-c wants to merge 1 commit into
OpenAPITools:masterfrom
mr-c:python-api-client-deserialize-typing

Conversation

@mr-c

@mr-c mr-c commented Nov 23, 2026 •

Copy link
Copy Markdown

response_type can absolutely be a non-string, as shown by the existing documentation and code paths

@cbornet @tomplus @krjakbrjak @fa0311 @AndreyVMarkelov

PR checklist

  • Read the contribution guidelines.
  • Run the following to build the project and update samples:
    ./mvnw clean package || exit
    ./bin/generate-samples.sh ./bin/configs/*.yaml || exit
    ./bin/utils/export_docs_generators.sh || exit
    
    (For Windows users, please run the script in WSL)
    Commit all changed files.
    This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
    These must match the expectations made by your contribution.
    You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example ./bin/generate-samples.sh bin/configs/java*.
    IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
  • If your PR is targeting a particular programming language, @mention the technical committee members, so they are more likely to review the pull request.

Summary by cubic

Fixes the response_type type hint in deserialize() to Union[str, object], since callers can pass non-string types like class objects or type literals. Applies the change to the Python api_client template and all regenerated samples.

Written for commit 698b222. Summary will update on new commits.

View guided diff

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 11 files

Reply to a comment to ask cubic a question or push back. It learns from your replies.

View guided diff | Re-trigger cubic

`response_type` can absolutely be a non-string, as shown by the existing
documentation and code paths
@mr-c
mr-c force-pushed the python-api-client-deserialize-typing branch from 9821734 to 698b222 Compare November 23, 2026 10:26
@mr-c

mr-c commented Nov 23, 2026

Copy link
Copy Markdown
Author

Looks like apt-get timed out in the CI. I would have restarted them myself, but I don't have permission. Or I can force-pushed an empty change..

@wing328

wing328 commented Nov 23, 2026

Copy link
Copy Markdown
Member

please ignore the circleci failure for the time being as python tests do not run on circleci.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants