swagger-api / swagger-api/swagger-codegen
[JAVA] Support generating client with multi-version models.
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 trying to generate a single Java client with multiple-version models. My models are like this:
configuration
|_ myapi
|_ v1
|_ my_fully_compliant.yaml
|_ v2
|_ my_fully_compliant.yaml
The my_fully_compliant.yaml contains configurations for all data models I will be using, but in different versions.
What I want is to generate a single Java client package that contains:
my.api
|_ v1
|_ client
|_ MyClient.java
|_ models
|_ SomeDataModel.java
|_ v2
|_ client
|_ MyClient.java
|_ models
|_ SomeDataModel.java
So that I can do use different version of SomeDataModel in the MyClient when sending requests to the API!
Swagger-codegen version
Swagger-codegen-cli = 3.x
Command line used for generation
language = spring
openapi = 3.0.2
Suggest a fix/enhancement
Suggest to enhance generating java client with multi-version models.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Java/Spring generation path for the provided OpenAPI 3.0.2 definition and how package and model names are configured. Compare the requested v1/v2 layout with the generated output; done means one client package contains separate versioned clients and models. No source file or test is named, so confirm scope and testing expectations with maintainers.
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
- Mostly clear
- Newbie friendliness
- 25/100