Skip to content

Commit

Permalink
fix: add retrofit adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosav committed Apr 10, 2024
1 parent 9384946 commit 541d2da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ dependencies {
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:$jacksonVersion")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin:$jacksonVersion")
implementation("com.squareup.retrofit2:retrofit:$retrofitVersion")
implementation("com.squareup.retrofit2:converter-jackson:$retrofitVersion")
}

tasks.test {
Expand Down
2 changes: 2 additions & 0 deletions src/main/kotlin/com/gmail/marcosav2010/MFPSkillServlet.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.gmail.marcosav2010.handlers.LaunchHandler
import com.gmail.marcosav2010.infrastructure.api.adapter.MFPApi
import com.gmail.marcosav2010.infrastructure.api.connector.MFPConnector
import retrofit2.Retrofit
import retrofit2.converter.jackson.JacksonConverterFactory
import retrofit2.create
import javax.servlet.annotation.WebServlet

Expand All @@ -20,6 +21,7 @@ class MFPSkillServlet : SkillServlet(getSkill()) {

private val clientConfig = Retrofit.Builder()
.baseUrl(Configuration.mfpApiServerUrl)
.addConverterFactory(JacksonConverterFactory.create())
.build()

private val connector = clientConfig.create<MFPConnector>()
Expand Down

0 comments on commit 541d2da

Please sign in to comment.