OpenAPITools / OpenAPITools/openapi-generator
[BUG] [python-nextgen]The method "parameters_to_url_query" throws an error when the input is of type List[int] because the join operation expects string types, but it is being applied to integers.
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 26.8k
- Forks
- 7.7k
- PR merge metrics
- PR metrics pending
Description
Bug Report Checklist
- Have you provided a full/minimal spec to reproduce the issue?
- Have you validated the input using an OpenAPI validator (example)?
- Have you tested with the latest master to confirm the issue still exists?
- Have you searched for related issues/PRs?
- What's the actual output vs expected output?
- [Optional] Sponsorship to speed up the bug fix or feature request (example)
Description
The method "parameters_to_url_query" throws an error when the input is of type List[int] because the join operation expects string types, but it is being applied to integers.
input is of type List[int]
Annotated[Optional[conlist(StrictInt)]
Run error
File "xx\api_client.py", line 552, in <listcomp>
return "&".join(["=".join(item) for item in new_params])
TypeError: sequence item 1: expected str instance, int found
api_client.py Lines of code
552 return "&".join(["=".join(item) for item in new_params])
Local modification valid
return "&".join(["=".join(str(item)) for item in new_params])
openapi-generator version
OpenAPI declaration file content or url
Generation Details
Steps to reproduce
Related issues/PRs
Suggest a fix
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in api_client.py around line 552 and reproduce the failure with a List[int] input such as Annotated[Optional[conlist(StrictInt)]]. Verify the parameters_to_url_query path and confirm that integer values no longer trigger the reported TypeError when building the URL query.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100