title: Why does Moshi parse integers, longs as Double?
body: <p>I'm trying to parse a not very well designed api's json using Moshi + kotlin. For some reasons it parses numbers like 71 as Double.</p>
  <p>The 3rd party api has a list of objects that could either look like:
  {&quot;foo&quot;:[[1234567000,12]]} // long, int
  or
  {&quot;foo&quot;:[[1234567000,&quot;string&quot;,0,2]]} // long, string, int, int</p>
  <p>Because of the 3rd party api I have the following kotlin class:</p>
  <pre><code>@JsonClass(generateAdapter = true)
  class D {
      var foo: List&lt;Any&gt; // I use Any because it can be either String or Int or Long
  }
  </code></pre>
  <p>and in my code I do something like:</p>
  <pre><code>val moshi = Moshi.Builder().build()
  val adapter = moshi.adapter(D::class.java)
  var D d = adapter.fromJson(&quot;{\&quot;foo\&quot;:[[1234567000,\&quot;string\&quot;,0,2]]}&quot;)
  var index = d.foo[2]
  var value : Long = 0
  // here I get an error: ClassCastException: java.lang.Double cannot be cast to java.lang.Long
  value = d.foo[index]
  </code></pre>
  <p>but for some reason Moshi converts the integers in the json string into Doubles instead of Int or Long. How could I fix it?</p>