Following does not work: ```@Serializable data cla...
# announcements
s
Following does not work:
Copy code
@Serializable
data class ApiResponse<T>(
    val result: T? = null,
    val error: ApiError? = null
)

call.respond(ApiResponse(result = gameEngine.newGame()))
But this does:
Copy code
@Serializable
class Foo(val bar: ApiResponse<String>)

call.respond(Foo(ApiResponse(result = gameEngine.newGame())))
Using ktor + serialization My question is why? and how can i achieve the first one. I am getting
Serializer for class 'ApiResponse' is not found
for 1st approach
m
try ApiResponse without the
data
s
Still the same error.
m
Can you?
s
It seems it does not work when I use it with ktor
same thing but with normal jvm app it still doesnt work