swagger-api / swagger-api/swagger-codegen

Add a prefix to all generated classes

Open
#10,347 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

When generating classes from openapi yaml file, we can only can add a prefix to model classes and enums.
Is there a way to do the same with all generated classes ?

I have to generate 2 clients in the same project but both are generated with i.e. ApiClient.java (even if it is in separate packages).
I would be great if we could add a prefix.

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, test, or entry point is named. Start by locating the OpenAPI YAML generation path and the Java client class-name handling, then compare how prefixes currently apply to model classes and enums. Done means a configurable prefix can apply to all generated classes so two clients can coexist without ApiClient.java name collisions.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.