OpenAPITools / OpenAPITools/openapi-generator

[BUG][Ruby] ApiError do not set the right error message

Open
#9,934 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.