OpenAPITools / OpenAPITools/openapi-generator

[BUG] [java] deprecated call to RequestBody.create (OAuthOkHttpClient)

Open
#17,224 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

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

Generated OAuthOkHttpClient.java has a deprecated call to RequestBody.create() (parameter reorder).

openapi-generator version

6.6.0 (Latest Version Tested)

Steps to reproduce

Generate a set of Java API Calls using a .yaml file.

Actual Results: The OAuthOkHttpClient class has a deprecated call to RequestBody.create
Expected Results: The OAuthOkHttpClient class should use the non deprecated call to RequestBody.create

Related issues/PRs

#13778 covers the same issue for a different generated class.

Suggest a fix

I'm assuming that this will be the same or a similar fix as was done in commit 9e5c919560b182a348fc4ffabcda01d7d3f97f26

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 by locating the template or source that generates OAuthOkHttpClient.java and compare the deprecated RequestBody.create call with the fix described in issue #13778 and commit 9e5c919560b182a348fc4ffabcda01d7d3f97f26. Regenerate a Java client from a YAML spec and verify that OAuthOkHttpClient uses the non-deprecated call.

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
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.