====== Swagger Code Generation ======
* [[programming:documentation:swagger|Swagger]] Code Generation
* [[https://github.com/swagger-api/swagger-codegen|swagger-api/swagger-codegen: swagger-codegen contains a template-driven engine to generate documentation, API clients and server stubs in different languages by parsing your OpenAPI / Swagger definition.]]
* [[http://www.baeldung.com/spring-boot-rest-client-swagger-codegen|Generate Spring Boot Project with Swagger | Baeldung]]
* [[https://swagger.io/docs/open-source-tools/swagger-codegen/|Swagger Codegen Document]]
===== Install with brew =====
brew install swagger-codegen
===== 명령행 예제 =====
# Download current stable 2.x.x branch (Swagger and OpenAPI version 2)
wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.15/swagger-codegen-cli-2.4.15.jar -O swagger-codegen-cli.jar
java -jar swagger-codegen-cli.jar help
# Download current stable 3.x.x branch (OpenAPI version 3)
wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.21/swagger-codegen-cli-3.0.21.jar -O swagger-codegen-cli.jar
java -jar swagger-codegen-cli.jar --help
# 실제 실행
java -jar swagger-codegen-cli.jar generate -i https://petstore.swagger.io/v2/swagger.json -l html -o /tmp/test/
# 지원 언어 목록 (-l)
java -jar swagger-codegen-cli.jar langs
===== Gradle Swagger Code Gen Plugin =====
* [[https://github.com/gigaSproule/swagger-gradle-plugin|gigaSproule/swagger-gradle-plugin: JAX-RS & SpringMVC supported gradle build plugin to generate Swagger documentation]]
* [[https://github.com/int128/gradle-swagger-generator-plugin|int128/gradle-swagger-generator-plugin: A Gradle plugin for OpenAPI YAML validation, code generation and API document publishing]]