OpenAPITools / OpenAPITools/openapi-generator

[REQ] Use interfaces for Java clients

Open
#2,917 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Enhancement: Feature
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

As of 4.0, the Java templates directly generate classes for FooApi. This makes testing and various AOP approaches more difficult. Instead, having a separate interface FooApi and a class FooApiClient/FooApiImpl implements FooApi would make testing code that relies on the client much easier, in addition to making it easier to add advice such as caching.

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 Java templates that currently generate the FooApi class and trace how Java clients are produced. Done means the generated client exposes a separate FooApi interface and a FooApiClient or FooApiImpl class implementing it, while preserving the intended client behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.