swagger-api / swagger-api/swagger-codegen

improvement: allow generation of independent models

Open
#9,889 0 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 am currently using SwaggerHub to generate a spring server and java clients, but only need the models from the java clients. The specific issue i'm running into is using the github integration to push updated clients to my repo. The models use the annotation '@Schema' which requires a swagger specific dependency. So, rather than pushing up the changed models and having to go in a delete the annotation every time, it would be ideal to be able to generate these without any dependency on swagger.

Even though this is only the codegen, it would be quicker to just download the yml and generate the models correctly (without the annotation) and push it up

swagger code-gen version
3.0.11

suggested fix/enhancement
It would be nice if the code-gen had an option to only generate the models independently of the rest of the code. This would mean the option to remove the '@Schema' annotation.

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

Review the codegen flow for Java clients and the generated models, focusing on how the @Schema annotation and model-only output are controlled. Define an option that generates independent models without the Swagger dependency, then verify that the generated models no longer contain @Schema and that normal client generation remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
tooling
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.