OpenAPITools / OpenAPITools/openapi-generator
[BUG][Ruby] ApiError do not set the right error message
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
when the API client get timeout and create an error with Connection timed out message
the error is then created with message Error message: the server returns an error
https://github.com/OpenAPITools/openapi-generator/blob/11515da0536dd3f72db3b20d5d4691da15f4b825/modules/openapi-generator/src/main/resources/ruby-client/api_client_typhoeus_partial.mustache#L15
https://github.com/OpenAPITools/openapi-generator/blob/11515da0536dd3f72db3b20d5d4691da15f4b825/modules/openapi-generator/src/main/resources/ruby-client/api_error.mustache#L37
I think it is because of the to_s overloading
openapi-generator version
gradle plugin 4.1.1
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 with modules/openapi-generator/src/main/resources/ruby-client/api_client_typhoeus_partial.mustache and api_error.mustache at the linked lines, then inspect how ApiError.to_s is used. Reproduce the timeout case described in the issue and verify that the resulting error preserves the “Connection timed out” message instead of replacing it with the generic server-error text.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- api
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100