plugins { id 'org.onap.portalng.history.java-application-conventions' id 'org.openapi.generator' } ext { openapiVersion = '7.0.0-beta' } dependencies { compileOnly "org.openapitools:openapi-generator:$openapiVersion" constraints { compileOnly('jakarta.validation:jakarta.validation-api:3.0.2') { because 'because min max validation wouldnt work with older versions of dependency' } } } // 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 = [ hideGenerationTimestamp: "true", openApiNullable: "false", skipDefaultInterface: "true", dateLibrary: "java8", interfaceOnly: "true", useTags: "true", useOptional: "true", reactive: "true", useSpringBoot3: "true" ] generateApiTests = false generateApiDocumentation = false generateModelTests = false generateModelDocumentation = false invokerPackage = "org.onap.portalng.history.openapi" apiPackage = "org.onap.portalng.history.openapi.api" modelPackage = "org.onap.portalng.history.openapi.model" } compileJava { dependsOn tasks.openApiGenerate } sourceSets { main { java { srcDirs += file("$buildDir/openapi/src/main/java") } } }