title: Using default JsonDeserializer inside custom JsonDeserializer in Kotlin
body: <p>I'm trying to build custom deserializers for the responses I get from <a href="http://www.omdbapi.com/" rel="nofollow noreferrer">OMDb API</a>.</p>
  
  <p>Here's the data class for <code>Movie</code>:</p>
  
  <pre class="lang-kotlin prettyprint-override"><code>data class Movie(
      val title: String?,
      val year: String?,
      val imdbID: String?,
      val type: String?,
      val poster: String?,
      val mpaRating: String?,
      val runtime: String?,
      val genres: String?,
      val director: String?,
      val writers: List&lt;String&gt;?,
      val actors: List&lt;String&gt;?,
      val plot: String?,
      val awards: String?,
      val boxOfficeEarnings: String?,
      val ratings: List&lt;Rating&gt;,
      val response: Boolean?
  )
  </code></pre>
  
  <p>And for <code>Rating</code>:</p>
  
  <pre class="lang-kotlin prettyprint-override"><code>data class Rating(
      @SerializedName("Source")
      val source: String,
      @SerializedName("Value")
      val value: String
  )
  </code></pre>
  
  <p>This is the custom <code>JsonDeserializer</code> so far:</p>
  
  <pre class="lang-kotlin prettyprint-override"><code>class MovieDeserializer : JsonDeserializer&lt;Movie&gt;
  {
      override fun deserialize(
          json: JsonElement?,
          typeOfT: Type?,
          context: JsonDeserializationContext?
      ): Movie
      {
          val movieJsonObject = json?.asJsonObject
          return Movie(
              movieJsonObject?.get("Title")?.asString,
              movieJsonObject?.get("Year")?.asString,
              movieJsonObject?.get("imdbID")?.asString,
              movieJsonObject?.get("Type")?.asString,
              movieJsonObject?.get("Poster")?.asString,
              movieJsonObject?.get("Rated")?.asString,
              movieJsonObject?.get("Runtime")?.asString,
              movieJsonObject?.get("Genre")?.asString,
              movieJsonObject?.get("Director")?.asString,
              separateStringByComma(movieJsonObject?.get("Writer")?.asString),
              separateStringByComma(movieJsonObject?.get("Actors")?.asString),
              movieJsonObject?.get("Plot")?.asString,
              movieJsonObject?.get("Awards")?.asString,
              movieJsonObject?.get("BoxOffice")?.asString,
              // this is where I need help,
              movieJsonObject?.get("Response")?.asBoolean
          )
      }
  
      fun separateStringByComma(stringToSeparate: String?): List&lt;String&gt;?
      {
          return stringToSeparate?.split(", ")
      }
  }
  </code></pre>
  
  <p>How can I convert that JsonElement directly to <code>List&lt;Rating&gt;</code> without some json string manipulation?</p>
  
  <p>By the way, I'm using Retrofit with Gson:</p>
  
  <pre class="lang-kotlin prettyprint-override"><code>val gsonMovieDeserializer = GsonBuilder()
              .registerTypeAdapter(Movie::class.java, MovieDeserializer())
              .create()
          val retrofit = Retrofit.Builder()
              .baseUrl("https://www.omdbapi.com/")
              .addConverterFactory(GsonConverterFactory.create(gsonMovieDeserializer))
              .build()
          val omdbApi = retrofit.create(OmdbApi::class.java)
          val movie = omdbApi.getMovie(movieImdbId.value.toString())
  </code></pre>