Skip to content
Template to Generate Micronaut-based server side java application from a swagger/openapi specification
Java Scala
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.mvn/wrapper
src
.gitattributes
.gitignore
.travis.yml
LICENSE
README.md
mvnw
mvnw.cmd
pom.xml

README.md

Build Status codecov Download

swagger-codegen-micronaut-generator

Template to Generate Micronaut-based server side java application from a swagger/openapi specification

How to Use

First, Download the jars

# download swagger cli
curl -O https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.10/swagger-codegen-cli-3.0.10.jar

# download micronaut generator
curl -O https://dl.bintray.com/franz-see/maven-repo/ph/net/see/swagger-codegen-micronaut-generator/1.0.1/swagger-codegen-micronaut-generator-1.0.1.jar

Next, use both jars to generate a micronaut project based on your swagger.yaml

java -cp swagger-codegen-micronaut-generator-1.0.1.jar:swagger-codegen-cli-3.0.10.jar \
  io.swagger.codegen.v3.cli.SwaggerCodegen \
  generate \
  -l ph.net.see.swaggercodegenmicronautgenerator.MicronautCodegen \
  -i /path/to/your/swagger.yaml \
  -o /where/you/want/the/project/to/be/generated

This will read your swagger/openapi configuration /path/to/your/swagger.yaml and generate the project directory in /where/you/want/the/project/to/be/generated.

The project it will generate will contain dtos for your API, config files, and the actual Api intefaces themselves. By default, these Api interfaces throw UnsupportedOperationException.

The next step would be to implement those Api interfaces with your @Controller classes, and start implementing those methods with actual logic.

Appendix

You can’t perform that action at this time.