title: Make Kotlin Serializer work with Retrofit
body: <p>I cant make Kotlin Serializer work with Retrofit. I am using <code>com.jakewharton.retrofit:retrofit2-kotlinx-serialization-converter:0.5.0</code> package along with Retrofit.</p>
  
  <h2>data classes</h2>
  
  <pre><code>import kotlinx.serialization.SerialName
  import kotlinx.serialization.Serializable
  
  
  @Serializable
  data class YelpSearchResult(
      @SerialName("total") val total: Int,
      @SerialName("businesses") val restaurants: List&lt;YelpRestaurant&gt;
  )
  
  data class YelpRestaurant(
      val name: String,
      val rating: Double,
      val price: String,
      @SerialName("review_count") val numReviews: Int,
      @SerialName("distance") val distanceInMeters: Double,
      @SerialName("image_url") val imageUrl: String,
      val categories: List&lt;YelpCategory&gt;,
      val location: YelpLocation
  ) {
  
      fun displayDistance(): String {
          val milesPerMeter = 0.000621371
          val distanceInMiles = "%.2f".format(distanceInMeters * milesPerMeter)
          return "$distanceInMiles mi"
      }
  }
  
  data class YelpCategory(
      val title: String
  )
  
  data class YelpLocation(
      @SerialName("address1") val address: String
  )
  </code></pre>
  
  <h2>service interface</h2>
  
  <pre><code>public interface YelpService {
      @GET("businesses/search")
      fun searchRestaurants(
          @Header("Authorization") authHeader: String,
          @Query("term") searchTerm: String,
          @Query("location") location: String): Call&lt;YelpSearchResult&gt;
  }
  </code></pre>
  
  <p>The Activity</p>
  
  <pre><code>    val contentType = MediaType.get("application/json")
      val retrofit = Retrofit.Builder()
              .baseUrl(BASE_URL)
              .addConverterFactory(Json.asConverterFactory(contentType))
              .build()
  
      val yelpService = retrofit.create(YelpService::class.java)
  
  
      yelpService.searchRestaurants("Bearer ${api_key}",
          "Something", "Some Location").enqueue(
              object: Callback&lt;YelpSearchResult&gt; {
                  override fun onFailure(call: Call&lt;YelpSearchResult&gt;, t: Throwable) {
                      Log.d("MainActivity", "err ${t}")
  
                  }
                  override fun onResponse(call: Call&lt;YelpSearchResult&gt;, response: Response&lt;YelpSearchResult&gt;) {
                      Log.d("MainActivity", "succ ${response}")
                  }
              }
      )
  </code></pre>
  
  <p>When Running, the thrown exception is,</p>
  
  <blockquote>
    <p>java.lang.RuntimeException: Unable to start activity
    ComponentInfo{com.xx.xx/com.xx.xx.MainActivity}:
    java.lang.IllegalArgumentException: Unable to create converter for
    class com.xx.xx.YelpSearchResult</p>
    
    <p>Unable to create converter for class com.xx.xx.YelpSearchResult
            for method YelpService.searchRestaurants</p>
    
    <p>Caused by: kotlinx.serialization.SerializationException: Can't locate
    argument-less serializer for class YelpSearchResult. For generic
    classes, such as lists, please provide serializer explicitly.</p>
  </blockquote>
  
  <p>What am I doing wrong? thanks for any directions.</p>