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?
Viktor Orlyk
04/24/2022, 5:53 PM
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