OpenAPITools / OpenAPITools/openapi-generator

[BUG][JAVA] ApiException does not expose detailMessage without the HTTP Response Info

Open
#18,050 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

Description

Calling ApiException.getMessage() includes the HTTP response code, response body and response headers as requested in issue 12205. I would like a way to fetch the detailMessage without this extra HTTP detail.

openapi-generator version

7.3.0

Generation Details

Java generation with OkHTTP GSON libraries

Steps to reproduce

Call getMessage() on a returned ApiException and it includes the detailMessage as well as HTTP Response information, there is no way to get just the detailMessage.

Related issues/PRs

https://github.com/OpenAPITools/openapi-generator/issues/12205

Suggest a fix

Provide a way to access just the message/detailMessage without the additional HTTP Response Info.

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 the generated Java ApiException class and the getMessage() path used by the OkHTTP GSON client; compare its detailMessage with the HTTP response code, body, and headers. Done means a caller can retrieve only detailMessage while the existing getMessage() behavior remains covered by the reproduction described for version 7.3.0.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.