plugins { id 'java' id 'idea' id 'org.openapi.generator' } repositories { mavenCentral() } dependencies { implementation 'org.openapitools:openapi-generator:6.2.0' implementation 'org.springframework.boot:spring-boot-starter-webflux:2.7.3' } // https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-gradle-plugin/README.adoc openApiGenerate { generatorName = "spring" library = "spring-boot" inputSpec = "$projectDir/src/main/resources/api/api.yml" outputDir = "$buildDir/openapi" configOptions = [ openApiNullable: "false", skipDefaultInterface: "true", dateLibrary: "java8", interfaceOnly: "true", useTags: "true", useOptional: "true", reactive: "true" ] generateApiTests = false generateApiDocumentation = false generateModelTests = false generateModelDocumentation = false invokerPackage = "org.onap.portal.prefs.openapi" apiPackage = "org.onap.portal.prefs.openapi.api" modelPackage = "org.onap.portal.prefs.openapi.model" } compileJava { dependsOn tasks.openApiGenerate } sourceSets { main { java { srcDirs += file("$buildDir/openapi/src/main/java") } } }