title: "No transformation found: class io.ktor.utils.io.ByteChannelNative" error using Ktor
body: <p>I'm trying to fetch and deserialize some data that is being hosted on <a href="https://raw.githubusercontent.com/Gmiller290488/kmm-demo/master/test.json" rel="nofollow noreferrer">github</a>.</p>
  <pre><code>{
    &quot;Meals&quot;: [
      {
        &quot;id&quot;: &quot;1598044e-5259-11e9-8647-d663bd870b02&quot;,
        &quot;name&quot;: &quot;Tomato pasta&quot;,
        &quot;quantity&quot;: [{
          &quot;quantity&quot;: 1 },
          {
            &quot;quantity&quot;: 2
          },
          {
            &quot;quantity&quot;: 3
          }],
        &quot;availableFromDate&quot;: &quot;1605802429&quot;,
        &quot;expiryDate&quot;: &quot;1905802429&quot;,
        &quot;info&quot;: &quot;Vegetarian&quot;,
        &quot;hot&quot;: false,
        &quot;locationLat&quot;: 57.508865,
        &quot;locationLong&quot;: -6.292,
        &quot;distance&quot;: null
      },
      {
        &quot;id&quot;: &quot;2be2d854-a067-43ec-a488-2e69f0f2a624&quot;,
        &quot;name&quot;: &quot;Pizza&quot;,
        &quot;quantity&quot;: [{
          &quot;quantity&quot;: 1 },
          {
          &quot;quantity&quot;: 2
          },
          {
            &quot;quantity&quot;: 3
          }
        ],
        &quot;availableFromDate&quot;: &quot;1605802429&quot;,
        &quot;expiryDate&quot;: &quot;1905902429&quot;,
        &quot;info&quot;: &quot;Meat&quot;,
        &quot;hot&quot;: false,
        &quot;locationLat&quot;: 51.509465,
        &quot;locationLong&quot;: -0.135392,
        &quot;distance&quot;: null
      }
    ]
  }
  </code></pre>
  <p>If I spin up a <a href="https://github.com/typicode/json-server" rel="nofollow noreferrer">json-server</a> locally then it works perfectly, so I know that my data class is not the problem. However when I try to do the same thing from that github link I get this error:</p>
  <p><code>Error Domain=KotlinException Code=0 &quot;No transformation found: class io.ktor.utils.io.ByteChannelNative -&gt; class kotlin.collections.List</code></p>
  <p>I have a feeling it might be to do with setting a ContentType or something along those lines but I haven't had any success specifying that so far.</p>
  <p>Here is my code to make the request:</p>
  <pre><code>class MealApi {
  
      private val httpClient = HttpClient {
          install(JsonFeature) {
              val json = Json { ignoreUnknownKeys = true }
              serializer = KotlinxSerializer(json)
          }
      }
  
      suspend fun getAllMeals(): List&lt;Meal&gt; {
          return httpClient.get(endpoint)
      }
  }
  </code></pre>
  <p>and here is my data class just for completeness:</p>
  <pre><code>@Serializable
  data class Meal(
      @SerialName(&quot;id&quot;)
      val id: String,
      @SerialName(&quot;name&quot;)
      val name: String,
      @SerialName(&quot;quantity&quot;)
      val quantity: List&lt;Quantity&gt;,
      @SerialName(&quot;availableFromDate&quot;)
      var availableFromDate: String,
      @SerialName(&quot;expiryDate&quot;)
      var expiryDate: String,
      @SerialName(&quot;info&quot;)
      val info: String,
      @SerialName(&quot;hot&quot;)
      val hot: Boolean,
      @SerialName(&quot;locationLat&quot;)
      val locationLat: Float,
      @SerialName(&quot;locationLong&quot;)
      val locationLong: Float,
      @SerialName(&quot;distance&quot;)
      var distance: Double? = null
  )
  
  @Serializable
  data class Quantity(
      @SerialName(&quot;quantity&quot;)
      val quantity: Int
  )
  </code></pre>
  <p><strong>UPDATE</strong></p>
  <p>I've found that this server <a href="https://gitcdn.link/" rel="nofollow noreferrer">https://gitcdn.link/</a> allows you to serve your raw github files with the right Content-Type.</p>