aboutsummaryrefslogtreecommitdiffstats
path: root/openapi/build.gradle
diff options
context:
space:
mode:
Diffstat (limited to 'openapi/build.gradle')
-rw-r--r--openapi/build.gradle27
1 files changed, 27 insertions, 0 deletions
diff --git a/openapi/build.gradle b/openapi/build.gradle
new file mode 100644
index 0000000..ee9ac96
--- /dev/null
+++ b/openapi/build.gradle
@@ -0,0 +1,27 @@
+apply plugin: 'org.openapi.generator'
+
+void createOpenApiGenerateClientTask(Project project, String apiDefinition, String packageName, String dtoSuffix) {
+ String taskName = "openApiGenerate_$packageName"
+ tasks.create(taskName, org.openapitools.generator.gradle.plugin.tasks.GenerateTask) {
+ generatorName = "java"
+ library = "webclient"
+ inputSpec = "${project.projectDir}/src/$apiDefinition".toString()
+ outputDir = "${project.buildDir}/openapi".toString()
+ configOptions = [
+ openApiNullable : "false",
+ dateLibrary : "java8",
+ serializationLibrary: "jackson"
+ ]
+ typeMappings = [
+ "File": "org.springframework.core.io.buffer.DataBuffer"
+ ]
+ generateApiTests = false
+ generateApiDocumentation = false
+ generateModelTests = false
+ generateModelDocumentation = false
+ invokerPackage = "org.onap.portal.bff.openapi.$packageName"
+ apiPackage = "org.onap.portal.bff.openapi.${packageName}.api"
+ modelPackage = "org.onap.portal.bff.openapi.${packageName}.model"
+ modelNameSuffix = dtoSuffix
+ }
+}