Forum Discussion

squarepot's avatar
squarepot
Visitor
5 years ago

[Java] How to generate a client with multi-version models?

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

 

All inputs are appreciated. Thank you! 

No RepliesBe the first to reply