Browse Source

fix: update vertx-web-kotlinx to adhere to the json test requirement (#9813)

Which is "For each request, an object mapping the key message to Hello, World! must be instantiated."
Alpha Ho 3 months ago
parent
commit
c22863ea0f

+ 1 - 1
frameworks/Kotlin/vertx-web-kotlinx/src/main/kotlin/MainVerticle.kt

@@ -153,7 +153,7 @@ class MainVerticle(val hasDb: Boolean) : CoroutineVerticle(), CoroutineRouterSup
 
     fun Router.routes() {
         get("/json").jsonResponseCoHandler(Serializers.message) {
-            jsonSerializationMessage
+            Message("Hello, World!")
         }
 
         get("/db").jsonResponseCoHandler(Serializers.world) {

+ 0 - 2
frameworks/Kotlin/vertx-web-kotlinx/src/main/kotlin/Models.kt

@@ -4,8 +4,6 @@ import kotlin.random.Random
 @Serializable
 class Message(val message: String)
 
-val jsonSerializationMessage = Message("Hello, World!")
-
 @Serializable
 data class World(val id: Int, val randomNumber: Int)