plugins { id 'java' id 'idea' id 'org.springframework.boot' id 'io.spring.dependency-management' id 'org.openapi.generator' } dependencies { implementation 'org.springframework.boot:spring-boot-starter-webflux' implementation "org.openapitools:openapi-generator:$openapiVersion" // implementation 'jakarta.validation:jakarta.validation-api:3.0.2' constraints { implementation('io.swagger.core.v3:swagger-annotations:2.2.5') { because 'there is a dependency conflict between swagger-parser versions 2 and 3 (https://github.com/OpenAPITools/openapi-generator/issues/14901)' } } } openApiGenerate { generatorName = "spring" library = "spring-boot" inputSpec = "$projectDir/src/main/resources/static/api.yaml" outputDir = "$buildDir/openapi" configOptions = [ hideGenerationTimestamp: "true", openApiNullable: "false", skipDefaultInterface: "true", dateLibrary: "java8", interfaceOnly: "true", useTags: "true", reactive: "true", useSpringBoot3: "true", ] generateApiTests = false generateApiDocumentation = true generateModelTests = false generateModelDocumentation = false invokerPackage = "org.onap.portalng.bff.openapi.server" apiPackage = "org.onap.portalng.bff.openapi.server.api" modelPackage = "org.onap.portalng.bff.openapi.server.model" modelNameSuffix = "ApiDto" } compileJava { dependsOn tasks.openApiGenerate } sourceSets { main { java { srcDirs += file("$buildDir/openapi/src/main/java") } } } idea { module { generatedSourceDirs += file("$buildDir/openapi/src/main/java") } } bootJar { enabled = false } jar { enabled = true }