title: Serializer for class '...' is not found. Mark the class as @Serializable or provide the serializer explicitly
body: <p>Hi I have a problem with serialization of class in kotlin</p>
  <p>build.gradl.kt</p>
  <pre><code>...
  plugins {
      application
      kotlin(&quot;jvm&quot;) version &quot;1.6.21&quot;
      kotlin(&quot;plugin.serialization&quot;).version(&quot;1.6.21&quot;)
  }
  ...
  depenedancies{
  ...
      implementation(&quot;io.ktor:ktor-server-content-negotiation:$ktor_version&quot;)
      implementation(&quot;io.ktor:ktor-serialization-kotlinx-json:$ktor_version&quot;)
  } 
  </code></pre>
  <p>Response.kt</p>
  <pre><code>import kotlinx.serialization.*
  ...
  interface BaseResponse&lt;T&gt;
  
  @Serializable
  data class PaginatedResponse&lt;T&gt;(
      val prev: Int?,
      val next: Int?,
      val totalCount: Int = 0,
      val totalPages: Int = 0,
      val data: T? = null,
      val message: String? = null
  ) : BaseResponse&lt;T&gt;
  </code></pre>
  <p>usage</p>
  <pre><code>...
    return PaginatedResponse&lt;List&lt;User&gt;&gt;(
                  prev,
                  next,
                  totalCount,
                  totalPages,
                  users
              )
  </code></pre>
  <p>data which I am passing looks quite healthy
  <a href="https://i.stack.imgur.com/wM1S1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wM1S1.png" alt="enter image description here" /></a>
  and the error which is thrown when return is reached is next</p>
  <pre><code>kotlinx.serialization.SerializationException: Serializer for class 'PaginatedResponse' is not found.
  Mark the class as @Serializable or provide the serializer explicitly.
  </code></pre>
  <p>doing
  call.respond(User(...)) will not throw any error</p>
  <p>so if I remove generic and make the PaginatedResponse non generic it will work but is not reusable anymore</p>
  <pre><code>@Serializable
  data class PaginatedResponse(
      val prev: Int?,
      val next: Int?,
      val totalCount: Long = 0,
      val totalPages: Long = 0,
      val data: List&lt;User&gt;? = null,
      val message: String? = null
  ) : BaseResponse&lt;User&gt;
  </code></pre>