2

Does anyone know how to generate java code from swagger 2.0

My library is swagger-codegen-cli-2.1.2.jar

Harsha Gayan
  • 339
  • 1
  • 5
  • 13
  • Possible duplicate of [How to generate java client code for swagger REST API documentation](https://stackoverflow.com/questions/33354557/how-to-generate-java-client-code-for-swagger-rest-api-documentation), [Swagger Codegen is not working while generating java client for a Rest API](https://stackoverflow.com/q/29537222/113116). – Helen Nov 06 '18 at 10:50

1 Answers1

4

There are multiple ways to generate either the server code or the client code.

  1. Using https://generator.swagger.io, you can generate it online by providing your swagger.json

  2. There are plugins for build tools like Maven and Gradle, for example thebignet/swagger-codegen-gradle-plugin, they have examples on their github page

  3. Using the command line by installing it on your OS (as explained on the swagger codegen github page). They also show a java -jar swagger-codegen-cli.jar help which should be of help!

Boris van Katwijk
  • 2,998
  • 4
  • 17
  • 32