OpenAPITools / OpenAPITools/openapi-generator
[BUG][PHP] operationAsyncWithHttpInfo incorrectly handles ConnectException (operationWithHttpInfo does this correct)
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?
- 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
Calling *AsyncWithHttpInfo breaks if a ConnectException is thrown, as this doesn't provide the getResponse method which is used in exception handling. *WithHttpInfo does this correctly and has a dedicated catch-branch for this.
openapi-generator version
docker image latest, branch master, e.g. now v7.21.0
OpenAPI declaration file content or url
not related to a specific declaration, applies to all due to the error handling
Generation Details
does not apply
Steps to reproduce
does not apply
Related issues/PRs
https://github.com/OpenAPITools/openapi-generator/pull/23455
Suggest a fix
Exception handling breaks for the Exception being of type ConnectException in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/php/api.mustache#L485, needs same logic as https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/php/api.mustache#L485
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
Read modules/openapi-generator/src/main/resources/php/api.mustache around line 485 and compare the async exception handling with the corresponding *WithHttpInfo path. Generate a PHP client and verify that a ConnectException is handled without calling getResponse; the related pull request shows that work is already underway.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100