From 83c6c1647cce9a49b5a4455bcdd7f4409b2f52a9 Mon Sep 17 00:00:00 2001 From: Danie Humphreys Date: Thu, 23 Jan 2025 08:57:22 +0000 Subject: [PATCH] Upgrade openapi plugin version from 7.7 to 7.11. In version 7.7 generating documentation via the openApi gradle task results in the following misleading warning: "More than one inline schema specified in allOf:. Only the first one is recognized. All others are ignored." See comments on this PR: https://github.com/OpenAPITools/openapi-generator/pull/19646. In later versions of the plugin - and rather than fixing the issue - the severity of the warning has been reduced from WARN to DEBUG. See: https://github.com/OpenAPITools/openapi-generator/pull/19646/files. Also set removeEnumValuePrefix = true since this is a new additional property added to more recent versions which removes the prefix for enum definitions. Previously in version 7.7 prefixes were removed automatically and the property didn't exist. Since it defaults to false we need to set it to true. See https://github.com/OpenAPITools/openapi-generator/pull/20452. Unfortunately this property isn't documented in the README https://github.com/OpenAPITools/openapi-generator/blob/master/docs/generators/kotlin-server.md#config-options. --- build.gradle.kts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.gradle.kts b/build.gradle.kts index 40d1d75c9f2..f41a0445ff9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ import org.apache.commons.io.FileUtils plugins { id("uk.gov.justice.hmpps.gradle-spring-boot") version "6.1.0" kotlin("plugin.spring") version "2.0.20" - id("org.openapi.generator") version "7.7.0" + id("org.openapi.generator") version "7.11.0" id("org.jetbrains.kotlin.plugin.jpa") version "1.9.22" id("io.gatling.gradle") version "3.13.1" id("io.gitlab.arturbosch.detekt") version "1.23.7" @@ -239,6 +239,7 @@ openApiGenerate { typeMappings.put("DateTime", "Instant") importMappings.put("Instant", "java.time.Instant") templateDir.set("$rootDir/openapi") + additionalProperties.put("removeEnumValuePrefix", "true") } registerAdditionalOpenApiGenerateTask(