swagger-api / swagger-api/swagger-codegen

[swagger-codegen] Generating single client for multiple API definitions

Open
#3,749 8 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

When we use swagger codegen to generate client side SDKs, we are able to generate one SDK per API definition (for a given language). Please refer the example below.

Eg : If we have 2 APIs, say "GeoAPI" and "TimeAPI", we need to generate 2 SDKs (i.e - 2 separate jar files) with the existing implementation, since the library supports only one definition at a time.

Limitation here is, if someone needs to consume both "GeoAPI" and "TimeAPI", he needs to write 2 separate clients.

If a user can get a single jar file and include it in his project, he can use a single client to consume both "GeoAPI" and "TimeAPI". For that, we need to have root pom.xml file which builds the individual SDKs. (This root pom.xml should be created automatically by the library at the time of SDK generation.) In other words we need to generate one client from multiple swagger definitions.

Please let us know the possibility of this with the current implementation of swagger codegen.

Swagger-codegen version

2.2.0

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

Read the current SDK generation flow and the root pom.xml build structure, then trace how one Swagger definition becomes a client artifact. The requested outcome is an automatically generated root pom.xml that combines multiple API definitions into a single consumable client or jar; review the existing implementation and build behavior before defining acceptance tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi
Domain
api, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.