Skip to content

Commit

Permalink
Use annotation for deserializer
Browse files Browse the repository at this point in the history
  • Loading branch information
tokou committed Aug 30, 2024
1 parent c07ed6f commit 13cfbb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.JsonParser
import com.fasterxml.jackson.databind.DeserializationContext
import com.fasterxml.jackson.databind.JsonDeserializer
import com.fasterxml.jackson.databind.JsonNode
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import maestro.Platform
import maestro.js.JsEngine
import maestro.orchestra.util.Env.evaluateScripts
Expand All @@ -30,6 +31,7 @@ data class MaestroConfig(

}

@JsonDeserialize(using = MaestroAppId.Deserializer::class)
data class MaestroAppId(
val android: String?,
val ios: String?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -598,10 +598,7 @@ internal class MaestroCommandSerializationTest {
.writerWithDefaultPrettyPrinter()
.writeValueAsString(this)

private val module = KotlinModule.Builder().build()
.addDeserializer(MaestroAppId::class.java, MaestroAppId.Deserializer())

private val objectMapper = ObjectMapper()
.setSerializationInclusion(Include.NON_NULL)
.registerModule(module)
.registerModule(KotlinModule.Builder().build())
}

0 comments on commit 13cfbb5

Please sign in to comment.