https://kotlinlang.org logo
#ktor
Title
# ktor
v

Viktor Orlyk

04/24/2022, 12:00 PM
Hi, all. Maybe someone can help me understand what is the problem with my code for class serialization? Not to polute the channel posted question on stackoverflow. Thanks in advance! https://stackoverflow.com/questions/71988144/serializer-for-class-is-not-found-mark-the-class-as-serializable-or-prov
c

Chrimaeon

04/24/2022, 2:27 PM
Better ask in #serialization but I think the issue is with the generic type.
v

Viktor Orlyk

04/24/2022, 5:49 PM
posted the question there. I wonder what is better solution to type an answer without generic for pagination in ktor?
yeah you are right, this works but it is not reusable(
Copy code
@Serializable
data class PaginatedResponse(
    val prev: Int?,
    val next: Int?,
    val totalCount: Long = 0,
    val totalPages: Long = 0,
    val data: List<User>? = null,
    val message: String? = null
) : BaseResponse<User>
c

Chrimaeon

04/24/2022, 5:57 PM
I guess you have to write your own “Serializer” for
PaginatedResponse
2 Views