Skip to content

Commit

Permalink
These static imports are important, they were accidentally removed (#42)
Browse files Browse the repository at this point in the history
* These static imports are important, they were accidentally removed when transitioning from Controller implementations to interfaces. There is a hole in our tests that doesn't pick this up, but it would be a time-consuming test to rejig

* fixing warning
  • Loading branch information
cjbooms authored May 1, 2021
1 parent eef549d commit 6dc029c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ class JacksonModelGenerator(
else -> emptySet()
}
}
else ->
emptySet()
}
}

Expand Down
11 changes: 10 additions & 1 deletion src/main/kotlin/com/cjbooms/fabrikt/model/KotlinGenModels.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.cjbooms.fabrikt.model

import com.cjbooms.fabrikt.generators.controller.metadata.SpringImports
import com.cjbooms.fabrikt.model.Destinations.clientPackage
import com.cjbooms.fabrikt.model.Destinations.controllersPackage
import com.cjbooms.fabrikt.model.Destinations.modelsPackage
Expand Down Expand Up @@ -49,7 +50,15 @@ data class Clients(val clients: Collection<ClientType>) : KotlinTypes(clients) {
}

data class Controllers(val controllers: Collection<ControllerType>) : KotlinTypes(controllers) {
override val files: Collection<FileSpec> = controllers.toFileSpec()
override val files: Collection<FileSpec> = super.files.map {
it.toBuilder()
.addImport(SpringImports.Static.REQUEST_METHOD.first, SpringImports.Static.REQUEST_METHOD.second)
.addImport(
SpringImports.Static.RESPONSE_STATUS.first,
SpringImports.Static.RESPONSE_STATUS.second
)
.build()
}
}

data class MethodSignature(val name: String, val returnType: TypeName, val parameters: List<IncomingParameter>)
Expand Down

0 comments on commit 6dc029c

Please sign in to comment.