swagger-api / swagger-api/swagger-codegen

Feature request: Generated ApiClient should implement a non-generated interface

Open
#5,248 2 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Client: Java General: Suggestion
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

Description

I like creating simplified facades on top of the generated java clients. I also ended up creating an abstract super class for common functionality of the multiple client facades. However, there is an issue, that I can not call any methods which are present in each ApiClient such as setConnectTimeout and setBasePath from the super class without using Java reflection, because the generated ApiClient does not implement any interface that I could use.

Swagger-codegen version

2.2.1

Suggest a Fix

Would it be possible to make it implement some interface or extend a super class, which would contain the shared methods and not be generated so that the type would be same for all?

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

No source file or test is named. Start by locating the Java ApiClient generation templates and the shared client methods such as setConnectTimeout and setBasePath; done means generated Java clients expose a common non-generated type that facade superclasses can call without reflection.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.