A Gradle plugin to support the swagger code generation project
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
swaggerInputSpec
- swagger spec file pathswaggerLanguage
- target generation language. Adapt sourceSet accordingly.swaggerTemplateDirectory
- directory with mustache templatesswaggerApiPackage
- package for default APIswaggerInvokerPackage
- package for invokerswaggerModelPackage
- package for modelsswaggerOutput
- 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