Repository: cjbooms/fabrikt
Pull request #46 (2021-05-14 14:18:45)

Bump kotlinand ktlint versions
Bump kotlin and ktlint versions

cjbooms: 👍 

Patch:
diff --git a/build.gradle.kts b/build.gradle.kts
index 2d55324..a232588 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -2,8 +2,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
 import org.jetbrains.dokka.gradle.DokkaTask
 
 plugins {
-    id("org.jetbrains.kotlin.jvm") version "1.3.61" // Apply the Kotlin JVM plugin to add support for Kotlin.
-    id("org.jmailen.kotlinter") version "2.3.2" // Lint and formatting for Kotlin using ktlint
+    id("org.jetbrains.kotlin.jvm") version "1.4.0" // Apply the Kotlin JVM plugin to add support for Kotlin.
     id("com.github.johnrengelman.shadow") version "4.0.1"
     id("org.jetbrains.dokka") version "0.10.1"
     id("com.palantir.git-version") version "0.12.3"
@@ -49,8 +48,9 @@ dependencies {
     implementation("com.reprezen.jsonoverlay:jsonoverlay:4.0.3")
     implementation("com.squareup:kotlinpoet:1.3.0") { exclude(module = "kotlin-stdlib-jre7") }
     implementation("com.google.flogger:flogger:0.4")
-    implementation("com.pinterest:ktlint:0.35.0") // In 0.36.0 programmatic linting is removed :'(
-
+    implementation("com.pinterest.ktlint:ktlint-core:0.41.0")
+    implementation("com.pinterest:ktlint:0.41.0")
+    
     testImplementation("org.junit.jupiter:junit-jupiter-api:5.1.0")
     testImplementation("org.junit.jupiter:junit-jupiter-engine:5.1.0")
     testImplementation("org.junit.jupiter:junit-jupiter-params:5.1.0")
@@ -67,8 +67,8 @@ tasks {
             attributes["Main-Class"] = "com.cjbooms.fabrikt.cli.CodeGen"
             attributes["Implementation-Title"] = "fabrikt"
             attributes["Implementation-Version"] = project.version
-            attributes["Built-JDK"] =  System.getProperty("java.version")
-            attributes["Built-Gradle"] =  gradle.gradleVersion
+            attributes["Built-JDK"] = System.getProperty("java.version")
+            attributes["Built-Gradle"] = gradle.gradleVersion
         }
         archiveBaseName.set(executableName)
         archiveClassifier.set("")
@@ -103,7 +103,6 @@ tasks {
         kotlinOptions {
             jvmTarget = "11"
         }
-        dependsOn(formatKotlin)
     }
 
     withType<Test> {
@@ -143,7 +142,7 @@ publishing {
                 developers {
                     developer {
                         id.set("cjbooms")
-                        name.set("Conor Gallaguer")
+                        name.set("Conor Gallagher")
                         email.set("cjbooms@gmail.com")
                     }
                     developer {
@@ -157,7 +156,6 @@ publishing {
                     developerConnection.set(projectScmDevUrl)
                     url.set(projectScmUrl)
                 }
-
             }
         }
     }
diff --git a/src/main/kotlin/com/cjbooms/fabrikt/generators/controller/ControllerGeneratorUtils.kt b/src/main/kotlin/com/cjbooms/fabrikt/generators/controller/ControllerGeneratorUtils.kt
index 46f2f11..7dde895 100644
--- a/src/main/kotlin/com/cjbooms/fabrikt/generators/controller/ControllerGeneratorUtils.kt
+++ b/src/main/kotlin/com/cjbooms/fabrikt/generators/controller/ControllerGeneratorUtils.kt
@@ -31,7 +31,7 @@ object ControllerGeneratorUtils {
             ?: Unit::class.asTypeName()
     }
 
-    fun Operation.happyPathResponseObject(): Response {
+    private fun Operation.happyPathResponseObject(): Response {
         val toResponseMapping: Map<Int, Response> = responses
             .filter { it.key != "default" }
             .map { (code, body) ->
@@ -39,7 +39,7 @@ object ControllerGeneratorUtils {
             }.toMap()
 
         // Happy path, just pull out the http code with the lowest value. Later we may have conditional responses
-        val code: Int = toResponseMapping.keys.min() ?: throw IllegalStateException("Could not extract the response for $this")
+        val code: Int = toResponseMapping.keys.minOrNull() ?: throw IllegalStateException("Could not extract the response for $this")
         val response = toResponseMapping[code]!!
 
         return response


Test patch:
diff --git a/src/test/kotlin/com/cjbooms/fabrikt/generators/ModelGeneratorTest.kt b/src/test/kotlin/com/cjbooms/fabrikt/generators/ModelGeneratorTest.kt
index 9d220e0..9ba4cda 100644
--- a/src/test/kotlin/com/cjbooms/fabrikt/generators/ModelGeneratorTest.kt
+++ b/src/test/kotlin/com/cjbooms/fabrikt/generators/ModelGeneratorTest.kt
@@ -6,20 +6,22 @@ import com.cjbooms.fabrikt.configurations.Packages
 import com.cjbooms.fabrikt.generators.model.JacksonModelGenerator
 import com.cjbooms.fabrikt.model.Models
 import com.cjbooms.fabrikt.model.SourceApi
+import com.cjbooms.fabrikt.util.ResourceHelper.readTextResource
 import com.cjbooms.fabrikt.validation.Linter
 import com.squareup.kotlinpoet.FileSpec
-import java.nio.file.Paths
-import java.util.stream.Stream
 import org.assertj.core.api.Assertions.assertThat
 import org.junit.jupiter.api.BeforeEach
 import org.junit.jupiter.api.Test
 import org.junit.jupiter.api.TestInstance
 import org.junit.jupiter.params.ParameterizedTest
 import org.junit.jupiter.params.provider.MethodSource
+import java.nio.file.Paths
+import java.util.stream.Stream
 
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 class ModelGeneratorTest {
 
+    @Suppress("unused")
     private fun testCases(): Stream<String> = Stream.of(
         "arrays",
         "anyOfOneOfAllOf",
@@ -52,9 +54,9 @@ class ModelGeneratorTest {
         print("Testcase: $testCaseName")
         MutableSettings.addOption(ModelCodeGenOptionType.X_EXTENSIBLE_ENUMS)
         val basePackage = "examples.$testCaseName"
-        val apiLocation = javaClass.getResource("/examples/$testCaseName/api.yaml")
+        val apiLocation = javaClass.getResource("/examples/$testCaseName/api.yaml")!!
         val sourceApi = SourceApi(apiLocation.readText(), baseDir = Paths.get(apiLocation.toURI()))
-        val expectedModels = javaClass.getResource("/examples/$testCaseName/models/Models.kt").readText()
+        val expectedModels = readTextResource("/examples/$testCaseName/models/Models.kt")
 
         val models = JacksonModelGenerator(
             Packages(basePackage),
@@ -67,8 +69,8 @@ class ModelGeneratorTest {
     @Test
     fun `sealed classes are correctly grouped into a single file`() {
         val basePackage = "examples.polymorphicModels.sealed"
-        val spec = javaClass.getResource("/examples/polymorphicModels/api.yaml").readText()
-        val expectedModels = javaClass.getResource("/examples/polymorphicModels/sealed/models/Models.kt").readText()
+        val spec = readTextResource("/examples/polymorphicModels/api.yaml")
+        val expectedModels = readTextResource("/examples/polymorphicModels/sealed/models/Models.kt")
 
         val models = JacksonModelGenerator(
             Packages(basePackage),
@@ -81,10 +83,14 @@ class ModelGeneratorTest {
     @Test
     fun `serializable models are generated from a full API definition when the java-serialized option is set`() {
         val basePackage = "examples.javaSerializableModels"
-        val spec = javaClass.getResource("/examples/javaSerializableModels/api.yaml").readText()
-        val expectedModels = javaClass.getResource("/examples/javaSerializableModels/models/Models.kt").readText()
+        val spec = readTextResource("/examples/javaSerializableModels/api.yaml")
+        val expectedModels = readTextResource("/examples/javaSerializableModels/models/Models.kt")
 
-        val models = JacksonModelGenerator(Packages(basePackage), SourceApi(spec), setOf(ModelCodeGenOptionType.JAVA_SERIALIZATION))
+        val models = JacksonModelGenerator(
+            Packages(basePackage),
+            SourceApi(spec),
+            setOf(ModelCodeGenOptionType.JAVA_SERIALIZATION)
+        )
             .generate()
             .toSingleFile()
 
@@ -94,12 +100,16 @@ class ModelGeneratorTest {
     @Test
     fun `quarkus reflection models are generated from a full API definition when the quarkus-reflection option is set`() {
         val basePackage = "examples.quarkusReflectionModels"
-        val spec = javaClass.getResource("/examples/quarkusReflectionModels/api.yaml").readText()
-        val expectedModels = javaClass.getResource("/examples/quarkusReflectionModels/models/Models.kt").readText()
+        val spec = readTextResource("/examples/quarkusReflectionModels/api.yaml")
+        val expectedModels = readTextResource("/examples/quarkusReflectionModels/models/Models.kt")
 
-        val models = JacksonModelGenerator(Packages(basePackage), SourceApi(spec), setOf(ModelCodeGenOptionType.QUARKUS_REFLECTION))
-                .generate()
-                .toSingleFile()
+        val models = JacksonModelGenerator(
+            Packages(basePackage),
+            SourceApi(spec),
+            setOf(ModelCodeGenOptionType.QUARKUS_REFLECTION)
+        )
+            .generate()
+            .toSingleFile()
 
         assertThat(models).isEqualTo(expectedModels)
     }
diff --git a/src/test/kotlin/com/cjbooms/fabrikt/generators/SpringControllerGeneratorTest.kt b/src/test/kotlin/com/cjbooms/fabrikt/generators/SpringControllerGeneratorTest.kt
index 60b08dc..4ec2a5a 100644
--- a/src/test/kotlin/com/cjbooms/fabrikt/generators/SpringControllerGeneratorTest.kt
+++ b/src/test/kotlin/com/cjbooms/fabrikt/generators/SpringControllerGeneratorTest.kt
@@ -8,28 +8,30 @@ import com.cjbooms.fabrikt.generators.model.JacksonModelGenerator
 import com.cjbooms.fabrikt.model.Controllers
 import com.cjbooms.fabrikt.model.Destinations.controllersPackage
 import com.cjbooms.fabrikt.model.SourceApi
+import com.cjbooms.fabrikt.util.ResourceHelper.readTextResource
 import com.cjbooms.fabrikt.validation.Linter
 import com.squareup.kotlinpoet.FileSpec
 import com.squareup.kotlinpoet.TypeSpec
-import java.util.stream.Stream
 import org.assertj.core.api.Assertions.assertThat
 import org.junit.jupiter.api.BeforeEach
 import org.junit.jupiter.api.Test
 import org.junit.jupiter.api.TestInstance
 import org.junit.jupiter.params.ParameterizedTest
 import org.junit.jupiter.params.provider.MethodSource
+import java.util.stream.Stream
 
 @TestInstance(TestInstance.Lifecycle.PER_CLASS)
 class SpringControllerGeneratorTest {
     private val basePackage = "ie.zalando"
     private lateinit var generated: Collection<FileSpec>
 
+    @Suppress("unused")
     private fun testCases(): Stream<String> = Stream.of(
         "githubApi"
     )
 
     private fun setupGithubApiTestEnv() {
-        val api = SourceApi(javaClass.getResource("/examples/githubApi/api.yaml").readText())
+        val api = SourceApi(readTextResource("/examples/githubApi/api.yaml"))
         val models = JacksonModelGenerator(Packages(basePackage), api).generate().models
         generated = SpringControllerInterfaceGenerator(Packages(basePackage), api, models).generate().files
     }
@@ -82,7 +84,7 @@ class SpringControllerGeneratorTest {
 
     @Test
     fun `ensure that subresource specific controllers are created`() {
-        val api = SourceApi(javaClass.getResource("/examples/githubApi/api.yaml").readText())
+        val api = SourceApi(readTextResource("/examples/githubApi/api.yaml"))
         val models = JacksonModelGenerator(Packages(basePackage), api).generate().models
         val controllers = SpringControllerInterfaceGenerator(Packages(basePackage), api, models).generate()
 
@@ -123,8 +125,8 @@ class SpringControllerGeneratorTest {
     @MethodSource("testCases")
     fun `correct models are generated for different OpenApi Specifications`(testCaseName: String) {
         val basePackage = "examples.$testCaseName"
-        val api = SourceApi(javaClass.getResource("/examples/$testCaseName/api.yaml").readText())
-        val expectedControllers = javaClass.getResource("/examples/$testCaseName/controllers/Controllers.kt").readText()
+        val api = SourceApi(readTextResource("/examples/$testCaseName/api.yaml"))
+        val expectedControllers = readTextResource("/examples/$testCaseName/controllers/Controllers.kt")
 
         val models = JacksonModelGenerator(Packages(basePackage), api).generate().models
         val controllers = SpringControllerInterfaceGenerator(
diff --git a/src/test/kotlin/com/cjbooms/fabrikt/util/ResourceHelper.kt b/src/test/kotlin/com/cjbooms/fabrikt/util/ResourceHelper.kt
new file mode 100644
index 0000000..a4146ee
--- /dev/null
+++ b/src/test/kotlin/com/cjbooms/fabrikt/util/ResourceHelper.kt
@@ -0,0 +1,5 @@
+package com.cjbooms.fabrikt.util
+
+object ResourceHelper {
+    fun readTextResource(path: String): String = javaClass.getResource(path)!!.readText()
+}
diff --git a/src/test/resources/examples/enumPolymorphicDiscriminator/models/Models.kt b/src/test/resources/examples/enumPolymorphicDiscriminator/models/Models.kt
index b4635ff..852392e 100644
--- a/src/test/resources/examples/enumPolymorphicDiscriminator/models/Models.kt
+++ b/src/test/resources/examples/enumPolymorphicDiscriminator/models/Models.kt
@@ -17,7 +17,7 @@ import kotlin.String
     JsonSubTypes.Type(
         value = ConcreteImplOne::class,
         name =
-            "obj_one"
+        "obj_one"
     ),
     JsonSubTypes.Type(value = ConcreteImplTwo::class, name = "obj_two")
 )
diff --git a/src/test/resources/examples/githubApi/controllers/Controllers.kt b/src/test/resources/examples/githubApi/controllers/Controllers.kt
index a6cc925..33eb27d 100644
--- a/src/test/resources/examples/githubApi/controllers/Controllers.kt
+++ b/src/test/resources/examples/githubApi/controllers/Controllers.kt
@@ -11,14 +11,6 @@ import examples.githubApi.models.PullRequestQueryResult
 import examples.githubApi.models.Repository
 import examples.githubApi.models.RepositoryQueryResult
 import examples.githubApi.models.StatusQueryParam
-import javax.validation.Valid
-import javax.validation.constraints.Max
-import javax.validation.constraints.Min
-import kotlin.Boolean
-import kotlin.Int
-import kotlin.String
-import kotlin.Unit
-import kotlin.collections.List
 import org.springframework.http.ResponseEntity
 import org.springframework.stereotype.Controller
 import org.springframework.validation.annotation.Validated
@@ -28,6 +20,14 @@ import org.springframework.web.bind.annotation.RequestHeader
 import org.springframework.web.bind.annotation.RequestMapping
 import org.springframework.web.bind.annotation.RequestMethod
 import org.springframework.web.bind.annotation.RequestParam
+import javax.validation.Valid
+import javax.validation.constraints.Max
+import javax.validation.constraints.Min
+import kotlin.Boolean
+import kotlin.Int
+import kotlin.String
+import kotlin.Unit
+import kotlin.collections.List
 
 @Controller
 @Validated
@@ -73,16 +73,11 @@ interface ContributorsController {
         method = [RequestMethod.GET]
     )
     fun get(
-        @Min(1)
-        @Max(100)
-        @RequestParam(value = "limit", required = false, defaultValue = "10")
+        @Min(1) @Max(100) @RequestParam(value = "limit", required = false, defaultValue = "10")
         limit: Int,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestParam(value = "include_inactive", required = false)
-        includeInactive: Boolean?,
-        @RequestParam(value = "cursor", required = false)
-        cursor: String?
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestParam(value = "include_inactive", required = false) includeInactive: Boolean?,
+        @RequestParam(value = "cursor", required = false) cursor: String?
     ): ResponseEntity<ContributorQueryResult>
 
     /**
@@ -109,10 +104,8 @@ interface ContributorsController {
     fun post(
         @RequestBody @Valid
         contributor: Contributor,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "Idempotency-Key", required = false)
-        idempotencyKey: String?
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "Idempotency-Key", required = false) idempotencyKey: String?
     ): ResponseEntity<Unit>
 
     /**
@@ -136,14 +129,11 @@ interface ContributorsController {
         method = [RequestMethod.GET]
     )
     fun getById(
-        @PathVariable(value = "id", required = true)
-        id: String,
+        @PathVariable(value = "id", required = true) id: String,
         @RequestParam(value = "status", required = false, defaultValue = "all")
         status: StatusQueryParam,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "If-None-Match", required = false)
-        ifNoneMatch: String?
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "If-None-Match", required = false) ifNoneMatch: String?
     ): ResponseEntity<Contributor>
 
     /**
@@ -176,14 +166,10 @@ interface ContributorsController {
     fun putById(
         @RequestBody @Valid
         contributor: Contributor,
-        @PathVariable(value = "id", required = true)
-        id: String,
-        @RequestHeader(value = "If-Match", required = true)
-        ifMatch: String,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "Idempotency-Key", required = false)
-        idempotencyKey: String?
+        @PathVariable(value = "id", required = true) id: String,
+        @RequestHeader(value = "If-Match", required = true) ifMatch: String,
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "Idempotency-Key", required = false) idempotencyKey: String?
     ): ResponseEntity<Unit>
 }
 
@@ -212,16 +198,11 @@ interface OrganisationsController {
         method = [RequestMethod.GET]
     )
     fun get(
-        @Min(1)
-        @Max(100)
-        @RequestParam(value = "limit", required = false, defaultValue = "10")
+        @Min(1) @Max(100) @RequestParam(value = "limit", required = false, defaultValue = "10")
         limit: Int,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestParam(value = "include_inactive", required = false)
-        includeInactive: Boolean?,
-        @RequestParam(value = "cursor", required = false)
-        cursor: String?
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestParam(value = "include_inactive", required = false) includeInactive: Boolean?,
+        @RequestParam(value = "cursor", required = false) cursor: String?
     ): ResponseEntity<OrganisationQueryResult>
 
     /**
@@ -248,10 +229,8 @@ interface OrganisationsController {
     fun post(
         @RequestBody @Valid
         organisation: Organisation,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "Idempotency-Key", required = false)
-        idempotencyKey: String?
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "Idempotency-Key", required = false) idempotencyKey: String?
     ): ResponseEntity<Unit>
 
     /**
@@ -275,14 +254,11 @@ interface OrganisationsController {
         method = [RequestMethod.GET]
     )
     fun getById(
-        @PathVariable(value = "id", required = true)
-        id: String,
+        @PathVariable(value = "id", required = true) id: String,
         @RequestParam(value = "status", required = false, defaultValue = "all")
         status: StatusQueryParam,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "If-None-Match", required = false)
-        ifNoneMatch: String?
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "If-None-Match", required = false) ifNoneMatch: String?
     ): ResponseEntity<Organisation>
 
     /**
@@ -315,14 +291,10 @@ interface OrganisationsController {
     fun putById(
         @RequestBody @Valid
         organisation: Organisation,
-        @PathVariable(value = "id", required = true)
-        id: String,
-        @RequestHeader(value = "If-Match", required = true)
-        ifMatch: String,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "Idempotency-Key", required = false)
-        idempotencyKey: String?
+        @PathVariable(value = "id", required = true) id: String,
+        @RequestHeader(value = "If-Match", required = true) ifMatch: String,
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "Idempotency-Key", required = false) idempotencyKey: String?
     ): ResponseEntity<Unit>
 }
 
@@ -353,18 +325,12 @@ interface OrganisationsContributorsController {
         method = [RequestMethod.GET]
     )
     fun get(
-        @PathVariable(value = "parent-id", required = true)
-        parentId: String,
-        @Min(1)
-        @Max(100)
-        @RequestParam(value = "limit", required = false, defaultValue = "10")
+        @PathVariable(value = "parent-id", required = true) parentId: String,
+        @Min(1) @Max(100) @RequestParam(value = "limit", required = false, defaultValue = "10")
         limit: Int,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestParam(value = "include_inactive", required = false)
-        includeInactive: Boolean?,
-        @RequestParam(value = "cursor", required = false)
-        cursor: String?
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestParam(value = "include_inactive", required = false) includeInactive: Boolean?,
+        @RequestParam(value = "cursor", required = false) cursor: String?
     ): ResponseEntity<ContributorQueryResult>
 
     /**
@@ -386,14 +352,10 @@ interface OrganisationsContributorsController {
         method = [RequestMethod.GET]
     )
     fun getById(
-        @PathVariable(value = "parent-id", required = true)
-        parentId: String,
-        @PathVariable(value = "id", required = true)
-        id: String,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "If-None-Match", required = false)
-        ifNoneMatch: String?
+        @PathVariable(value = "parent-id", required = true) parentId: String,
+        @PathVariable(value = "id", required = true) id: String,
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "If-None-Match", required = false) ifNoneMatch: String?
     ): ResponseEntity<Contributor>
 
     /**
@@ -424,16 +386,11 @@ interface OrganisationsContributorsController {
         method = [RequestMethod.PUT]
     )
     fun putById(
-        @PathVariable(value = "parent-id", required = true)
-        parentId: String,
-        @PathVariable(value = "id", required = true)
-        id: String,
-        @RequestHeader(value = "If-Match", required = true)
-        ifMatch: String,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "Idempotency-Key", required = false)
-        idempotencyKey: String?
+        @PathVariable(value = "parent-id", required = true) parentId: String,
+        @PathVariable(value = "id", required = true) id: String,
+        @RequestHeader(value = "If-Match", required = true) ifMatch: String,
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "Idempotency-Key", required = false) idempotencyKey: String?
     ): ResponseEntity<Unit>
 
     /**
@@ -451,12 +408,9 @@ interface OrganisationsContributorsController {
         method = [RequestMethod.DELETE]
     )
     fun deleteById(
-        @PathVariable(value = "parent-id", required = true)
-        parentId: String,
-        @PathVariable(value = "id", required = true)
-        id: String,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?
+        @PathVariable(value = "parent-id", required = true) parentId: String,
+        @PathVariable(value = "id", required = true) id: String,
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?
     ): ResponseEntity<Unit>
 }
 
@@ -489,22 +443,15 @@ interface RepositoriesController {
         method = [RequestMethod.GET]
     )
     fun get(
-        @Min(1)
-        @Max(100)
-        @RequestParam(value = "limit", required = false, defaultValue = "10")
+        @Min(1) @Max(100) @RequestParam(value = "limit", required = false, defaultValue = "10")
         limit: Int,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @Valid
-        @RequestParam(value = "slug", required = false)
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @Valid @RequestParam(value = "slug", required = false)
         slug: List<String>?,
-        @Valid
-        @RequestParam(value = "name", required = false)
+        @Valid @RequestParam(value = "name", required = false)
         name: List<String>?,
-        @RequestParam(value = "include_inactive", required = false)
-        includeInactive: Boolean?,
-        @RequestParam(value = "cursor", required = false)
-        cursor: String?
+        @RequestParam(value = "include_inactive", required = false) includeInactive: Boolean?,
+        @RequestParam(value = "cursor", required = false) cursor: String?
     ): ResponseEntity<RepositoryQueryResult>
 
     /**
@@ -531,10 +478,8 @@ interface RepositoriesController {
     fun post(
         @RequestBody @Valid
         repository: Repository,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "Idempotency-Key", required = false)
-        idempotencyKey: String?
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "Idempotency-Key", required = false) idempotencyKey: String?
     ): ResponseEntity<Unit>
 
     /**
@@ -558,14 +503,11 @@ interface RepositoriesController {
         method = [RequestMethod.GET]
     )
     fun getById(
-        @PathVariable(value = "id", required = true)
-        id: String,
+        @PathVariable(value = "id", required = true) id: String,
         @RequestParam(value = "status", required = false, defaultValue = "all")
         status: StatusQueryParam,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "If-None-Match", required = false)
-        ifNoneMatch: String?
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "If-None-Match", required = false) ifNoneMatch: String?
     ): ResponseEntity<Repository>
 
     /**
@@ -598,14 +540,10 @@ interface RepositoriesController {
     fun putById(
         @RequestBody @Valid
         repository: Repository,
-        @PathVariable(value = "id", required = true)
-        id: String,
-        @RequestHeader(value = "If-Match", required = true)
-        ifMatch: String,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "Idempotency-Key", required = false)
-        idempotencyKey: String?
+        @PathVariable(value = "id", required = true) id: String,
+        @RequestHeader(value = "If-Match", required = true) ifMatch: String,
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "Idempotency-Key", required = false) idempotencyKey: String?
     ): ResponseEntity<Unit>
 }
 
@@ -636,18 +574,12 @@ interface RepositoriesPullRequestsController {
         method = [RequestMethod.GET]
     )
     fun get(
-        @PathVariable(value = "parent-id", required = true)
-        parentId: String,
-        @Min(1)
-        @Max(100)
-        @RequestParam(value = "limit", required = false, defaultValue = "10")
+        @PathVariable(value = "parent-id", required = true) parentId: String,
+        @Min(1) @Max(100) @RequestParam(value = "limit", required = false, defaultValue = "10")
         limit: Int,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestParam(value = "include_inactive", required = false)
-        includeInactive: Boolean?,
-        @RequestParam(value = "cursor", required = false)
-        cursor: String?
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestParam(value = "include_inactive", required = false) includeInactive: Boolean?,
+        @RequestParam(value = "cursor", required = false) cursor: String?
     ): ResponseEntity<PullRequestQueryResult>
 
     /**
@@ -675,12 +607,9 @@ interface RepositoriesPullRequestsController {
     fun post(
         @RequestBody @Valid
         pullRequest: PullRequest,
-        @PathVariable(value = "parent-id", required = true)
-        parentId: String,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "Idempotency-Key", required = false)
-        idempotencyKey: String?
+        @PathVariable(value = "parent-id", required = true) parentId: String,
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "Idempotency-Key", required = false) idempotencyKey: String?
     ): ResponseEntity<Unit>
 
     /**
@@ -702,14 +631,10 @@ interface RepositoriesPullRequestsController {
         method = [RequestMethod.GET]
     )
     fun getById(
-        @PathVariable(value = "parent-id", required = true)
-        parentId: String,
-        @PathVariable(value = "id", required = true)
-        id: String,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "If-None-Match", required = false)
-        ifNoneMatch: String?
+        @PathVariable(value = "parent-id", required = true) parentId: String,
+        @PathVariable(value = "id", required = true) id: String,
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "If-None-Match", required = false) ifNoneMatch: String?
     ): ResponseEntity<PullRequest>
 
     /**
@@ -743,15 +668,10 @@ interface RepositoriesPullRequestsController {
     fun putById(
         @RequestBody @Valid
         pullRequest: PullRequest,
-        @PathVariable(value = "parent-id", required = true)
-        parentId: String,
-        @PathVariable(value = "id", required = true)
-        id: String,
-        @RequestHeader(value = "If-Match", required = true)
-        ifMatch: String,
-        @RequestHeader(value = "X-Flow-Id", required = false)
-        xFlowId: String?,
-        @RequestHeader(value = "Idempotency-Key", required = false)
-        idempotencyKey: String?
+        @PathVariable(value = "parent-id", required = true) parentId: String,
+        @PathVariable(value = "id", required = true) id: String,
+        @RequestHeader(value = "If-Match", required = true) ifMatch: String,
+        @RequestHeader(value = "X-Flow-Id", required = false) xFlowId: String?,
+        @RequestHeader(value = "Idempotency-Key", required = false) idempotencyKey: String?
     ): ResponseEntity<Unit>
 }
diff --git a/src/test/resources/examples/javaSerializableModels/models/Models.kt b/src/test/resources/examples/javaSerializableModels/models/Models.kt
index 6b7cf9c..b01a8f5 100644
--- a/src/test/resources/examples/javaSerializableModels/models/Models.kt
+++ b/src/test/resources/examples/javaSerializableModels/models/Models.kt
@@ -33,12 +33,12 @@ data class QueryResult(
     JsonSubTypes.Type(
         value = FirstModel::class,
         name =
-            "first_model"
+        "first_model"
     ),
     JsonSubTypes.Type(
         value = SecondModel::class,
         name =
-            "second_model"
+        "second_model"
     ),
     JsonSubTypes.Type(value = ThirdModel::class, name = "third_model")
 )
diff --git a/src/test/resources/examples/okHttpClient/client/ApiClient.kt b/src/test/resources/examples/okHttpClient/client/ApiClient.kt
index 76e3e7c..6ffd262 100644
--- a/src/test/resources/examples/okHttpClient/client/ApiClient.kt
+++ b/src/test/resources/examples/okHttpClient/client/ApiClient.kt
@@ -5,13 +5,6 @@ import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
 import examples.okHttpClient.models.Content
 import examples.okHttpClient.models.FirstModel
 import examples.okHttpClient.models.QueryResult
-import kotlin.Boolean
-import kotlin.Int
-import kotlin.String
-import kotlin.Suppress
-import kotlin.Unit
-import kotlin.collections.List
-import kotlin.jvm.Throws
 import okhttp3.Headers
 import okhttp3.HttpUrl
 import okhttp3.HttpUrl.Companion.toHttpUrl
@@ -19,6 +12,13 @@ import okhttp3.MediaType.Companion.toMediaType
 import okhttp3.OkHttpClient
 import okhttp3.Request
 import okhttp3.RequestBody.Companion.toRequestBody
+import kotlin.Boolean
+import kotlin.Int
+import kotlin.String
+import kotlin.Suppress
+import kotlin.Unit
+import kotlin.collections.List
+import kotlin.jvm.Throws
 
 @Suppress("unused")
 class ExamplePathClient(
diff --git a/src/test/resources/examples/okHttpClient/client/ApiService.kt b/src/test/resources/examples/okHttpClient/client/ApiService.kt
index aed769d..ebc668b 100644
--- a/src/test/resources/examples/okHttpClient/client/ApiService.kt
+++ b/src/test/resources/examples/okHttpClient/client/ApiService.kt
@@ -5,6 +5,7 @@ import examples.okHttpClient.models.Content
 import examples.okHttpClient.models.FirstModel
 import examples.okHttpClient.models.QueryResult
 import io.github.resilience4j.circuitbreaker.CircuitBreakerRegistry
+import okhttp3.OkHttpClient
 import kotlin.Boolean
 import kotlin.Int
 import kotlin.String
@@ -12,7 +13,6 @@ import kotlin.Suppress
 import kotlin.Unit
 import kotlin.collections.List
 import kotlin.jvm.Throws
-import okhttp3.OkHttpClient
 
 /**
  * The circuit breaker registry should have the proper configuration to correctly action on circuit
@@ -95,7 +95,8 @@ class ExamplePathSubresourceService(
 
     private val apiClient: ExamplePathSubresourceClient = ExamplePathSubresourceClient(
         objectMapper,
-        baseUrl, client
+        baseUrl,
+        client
     )
 
     @Throws(ApiException::class)
diff --git a/src/test/resources/examples/okHttpClient/models/Models.kt b/src/test/resources/examples/okHttpClient/models/Models.kt
index 7d5ee89..7b86170 100644
--- a/src/test/resources/examples/okHttpClient/models/Models.kt
+++ b/src/test/resources/examples/okHttpClient/models/Models.kt
@@ -32,12 +32,12 @@ data class QueryResult(
     JsonSubTypes.Type(
         value = FirstModel::class,
         name =
-            "first_model"
+        "first_model"
     ),
     JsonSubTypes.Type(
         value = SecondModel::class,
         name =
-            "second_model"
+        "second_model"
     ),
     JsonSubTypes.Type(value = ThirdModel::class, name = "third_model")
 )
diff --git a/src/test/resources/examples/oneOfPolymorphicModels/models/Models.kt b/src/test/resources/examples/oneOfPolymorphicModels/models/Models.kt
index e14b3a2..c942c80 100644
--- a/src/test/resources/examples/oneOfPolymorphicModels/models/Models.kt
+++ b/src/test/resources/examples/oneOfPolymorphicModels/models/Models.kt
@@ -30,12 +30,12 @@ data class ContainsOneOfPolymorphicTypes(
     JsonSubTypes.Type(
         value = PolymorphicTypeOneA::class,
         name =
-            "PolymorphicTypeOneA"
+        "PolymorphicTypeOneA"
     ),
     JsonSubTypes.Type(
         value = PolymorphicTypeOneB::class,
         name =
-            "PolymorphicTypeOneB"
+        "PolymorphicTypeOneB"
     )
 )
 sealed class PolymorphicSuperTypeOne() {
@@ -72,12 +72,12 @@ data class PolymorphicTypeOneB(
     JsonSubTypes.Type(
         value = PolymorphicTypeTwoA::class,
         name =
-            "PolymorphicTypeTwoA"
+        "PolymorphicTypeTwoA"
     ),
     JsonSubTypes.Type(
         value = PolymorphicTypeTwoB::class,
         name =
-            "PolymorphicTypeTwoB"
+        "PolymorphicTypeTwoB"
     )
 )
 sealed class PolymorphicSuperTypeTwo() {
diff --git a/src/test/resources/examples/polymorphicModels/models/Models.kt b/src/test/resources/examples/polymorphicModels/models/Models.kt
index 23141c4..c397446 100644
--- a/src/test/resources/examples/polymorphicModels/models/Models.kt
+++ b/src/test/resources/examples/polymorphicModels/models/Models.kt
@@ -17,12 +17,12 @@ import kotlin.String
     JsonSubTypes.Type(
         value = PolymorphicTypeOne::class,
         name =
-            "PolymorphicTypeOne"
+        "PolymorphicTypeOne"
     ),
     JsonSubTypes.Type(
         value = PolymorphicTypeTwo::class,
         name =
-            "PolymorphicTypeTwo"
+        "PolymorphicTypeTwo"
     )
 )
 sealed class PolymorphicSuperType(
diff --git a/src/test/resources/examples/polymorphicModels/sealed/models/Models.kt b/src/test/resources/examples/polymorphicModels/sealed/models/Models.kt
index c6272d1..56fa590 100644
--- a/src/test/resources/examples/polymorphicModels/sealed/models/Models.kt
+++ b/src/test/resources/examples/polymorphicModels/sealed/models/Models.kt
@@ -17,12 +17,12 @@ import kotlin.String
     JsonSubTypes.Type(
         value = PolymorphicTypeOne::class,
         name =
-            "PolymorphicTypeOne"
+        "PolymorphicTypeOne"
     ),
     JsonSubTypes.Type(
         value = PolymorphicTypeTwo::class,
         name =
-            "PolymorphicTypeTwo"
+        "PolymorphicTypeTwo"
     )
 )
 sealed class PolymorphicSuperType(
diff --git a/src/test/resources/examples/quarkusReflectionModels/models/Models.kt b/src/test/resources/examples/quarkusReflectionModels/models/Models.kt
index 1a08bff..143450d 100644
--- a/src/test/resources/examples/quarkusReflectionModels/models/Models.kt
+++ b/src/test/resources/examples/quarkusReflectionModels/models/Models.kt
@@ -34,12 +34,12 @@ data class QueryResult(
     JsonSubTypes.Type(
         value = FirstModel::class,
         name =
-            "first_model"
+        "first_model"
     ),
     JsonSubTypes.Type(
         value = SecondModel::class,
         name =
-            "second_model"
+        "second_model"
     ),
     JsonSubTypes.Type(value = ThirdModel::class, name = "third_model")
 )