Sourabh Rawat
10/26/2020, 10:07 AM@Serializable
data class ApiResponse<T>(
val result: T? = null,
val error: ApiError? = null
)
call.respond(ApiResponse(result = gameEngine.newGame()))
But this does:
@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 approachMichael de Kaste
10/26/2020, 11:19 AMdata
Sourabh Rawat
10/26/2020, 11:20 AMMaksym Plencler
10/26/2020, 11:45 AMMaksym Plencler
10/26/2020, 11:45 AMSourabh Rawat
10/26/2020, 12:01 PMSourabh Rawat
10/26/2020, 12:01 PMSourabh Rawat
10/26/2020, 12:26 PM