swagger-api / swagger-api/swagger-codegen

Don't generate model at all (but instead refer back to the original classes)

Open
#3,048 8 comments 0 reactions 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

Description

I've searched around, generally & in the issues, but can't find a way to do this. I'd like no model at all to be generated, but instead have the generated code refer back to the original model classes. The --import-mapping option is just too cumbersome. I have a separate jar for my models and I'd just like to use that, even if I have to fix my pom file manually.

Swagger-codegen version

2.1.6

Suggest a Fix

Have an option that just doesn't generate models at all, but assumes that the original model classes will be on the class path.

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 tracing the existing --import-mapping option and the model-generation path in swagger-codegen. Check how generated code refers to models and determine the scope of an option that suppresses model generation while using classes from the separate jar. Done means generated code builds against those original classes without generated model files.

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
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.