Skip to content

Instantly share code, notes, and snippets.

@justin-lyon
Created September 30, 2020 00:37
Show Gist options
  • Save justin-lyon/5b06198cfb628b382f47e3577f9c8f57 to your computer and use it in GitHub Desktop.
Save justin-lyon/5b06198cfb628b382f47e3577f9c8f57 to your computer and use it in GitHub Desktop.
swagger codegen instructions

swagger-codegen-for-cheaters

Generate a Java8 Spring App with Swagger Codegen

Download the latest Swagger Codegen CLI jar from (maven central)[https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/]

Execute the following command from the jar against your openapi-swagger-spec.json

# Powershell
java -jar .\swagger-codegen-cli-2.4.15.jar generate `
  -i .\openapi-swagger-spec.json `
  --api-package com.foo.bar.controller `
  --model-package com.foo.bar.model `
  --invoker-package com.foo.bar.service `
  -l spring `
  --additional-properties dateLibrary=java8-localdatetime `
  --group-id com.foo.bar `
  --artifact-id petstore-demo `
  --artifact-version 0.0.1-SNAPSHOT `
  -o petstore-demo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment