Skip to content

pbouillet/swagger-codegen-gradle-plugin

 
 

Repository files navigation

swagger-codegen-maven-plugin

Build Status

A Gradle plugin to support the swagger code generation project

Usage

Add to your build.gradle the following

ext {
    swaggerInputSpec = 'src/main/resources/petstore.yaml'
    swaggerOutput = 'src/swagger'
    swaggerLanguage = 'java'
}

apply plugin: 'org.detoeuf.swagger-code-gen'

sourceSets {
    swagger {
        java.srcDir file('src/swagger/java')
    }
}

Launch with:

gradle swagger

Configuration parameters

  • swaggerInputSpec - swagger spec file path
  • swaggerLanguage - target generation language. Adapt sourceSet accordingly.
  • swaggerTemplateDirectory - directory with mustache templates
  • swaggerApiPackage - package for default API
  • swaggerInvokerPackage - package for invoker
  • swaggerModelPackage - package for models
  • swaggerOutput - target output path (default is ${project.build.directory}/generated-sources/swagger)
  • swaggerSrc - target source directory (default is ${project.root.directory}/src/swagger). This directory should be added as as source set

About

A Maven plugin to support the swagger code generation project

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Groovy 100.0%