A Gradle plugin to support the swagger code generation project
see the swagger-codegen-gradle-plugin-example, or:
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 APIswaggerApiConfig
- package for configurationswaggerInvokerPackage
- package for invokerswaggerModelPackage
- package for modelsswaggerOutput
- target output path (default is ${project.build.directory}/generated-sources/swagger)swaggerLibrary
- library template (sub-template) to use