swagger-api / swagger-api/swagger-codegen

Separate non-generated parts of client (such as REST/API client) into a package

Open
#6,191 1 comment 1 reaction 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

I am going to use python as an example, but this can be applied to most of other client libraries too.

Right now, some part of client files such as (https://github.com/swagger-api/swagger-codegen/blob/master/modules/swagger-codegen/src/main/resources/python/api_client.mustache) is not affected by input. These files are mainly responsible for providing http/auth support for API calls.

I suggest we move them into a separate repo (swagger-base-clients) and publish them as an stand alone working client and then put a dependency on that package into generated client.

This further allow us (kubernetes) to develop our own base client with interface compatibility with swagger-base-client and switch it in kubernetes generated client.

If there is community interest in this, I can write a proposal/mock up for one language to see how it look like.

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 modules/swagger-codegen/src/main/resources/python/api_client.mustache and compare its non-generated HTTP and authentication responsibilities with the generated client structure. The issue proposes a separate swagger-base-clients repository and a dependency, but leaves the language, package design, compatibility interface, and implementation scope open. A useful next step would be a proposal or mock-up for one language, with a defined standalone client and integration boundary.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.