My scenario is the following.
I have a swagger .json eg.: http://petstore.swagger.io/v2/swagger.json I want to use a generated java client for the REST API above, li
For your scenario your command should look like this
java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate
-i http://petstore.swagger.io/v2/swagger.json
-l java
-o samples/server/petstore/spring-mvc
Other options to convert swagger to jave are:
Though with the GitHub project it's up to you to decide which library (jersey, jersey2, okhttp-gson, etc.) to use when converting swagger to Java client or server code. With generator.swagger.io you can also decide which library to use. There might be an enhancement to editor.swagger.io to be able to select the library to use as well. To consider is that the swagger.io options are completely free, whereas Restlet and APIMATIC are freemium.