title: Kotlinx Serialization MissingFieldException
body: <p>I am in the process of converting from Moshi to kotlinx serialization with Ktor and when I try to make a request to get data I am getting this error</p>
  <blockquote>
  <p>kotlinx.serialization.MissingFieldException: Field 'attachments' is
  required, but it was missing</p>
  </blockquote>
  <p>which makes sense since this specific response does not contain this field</p>
  <p>Response Json</p>
  <pre><code>{
      &quot;data&quot;: {
          &quot;id&quot;: &quot;1299418846990921728&quot;,
          &quot;text&quot;: &quot;This is a test&quot;
      }
  }
  </code></pre>
  <p>BUT my Serialized class has the <code>attachments</code> field as nullable (it is in the response only when it needs to be) so it should just ignore it I thought like it did with Moshi</p>
  <pre><code>@Serializable
  data class ResponseData(
      val id: Long
      val attachments: Attachments?,
      val author_id: String?,
      val text: String
  }
  </code></pre>
  <p>In my Ktor client setup I have it set to ignore unknown keys</p>
  <pre><code>private val _client: HttpClient = HttpClient(engine) {
      install(JsonFeature) {
          val json = Json {
              this.isLenient = true
              this.ignoreUnknownKeys = true
          }
          serializer = KotlinxSerializer(json)
      }
  }
  </code></pre>
  <p>Why is it still saying that the field is required even though its nullable?</p>