title: getting weather results from json (kotlin android)
body: <p>I'm trying to get some results from json but i have a problem.When i have only this line of code it works and i can get the temperature</p>
  
  <pre><code>var main: TemperatureData? = null
  </code></pre>
  
  <p>but i want also to get more values from my json so i insert this line of code </p>
  
  <pre><code>var weather: WeatherDataJson? = null
  </code></pre>
  
  <p>When i'm adding the second line it doesn't fetch any data(it even stops fetching the var main:... data)</p>
  
  <p>This is my weather data class</p>
  
  <pre><code>class WeatherData {
      var main: TemperatureData? = null
      var weather: WeatherDataJson? = null
  
  }
  </code></pre>
  
  <p>here is my interface class</p>
  
  <pre><code>interface ApiInterface {
      @GET("data/2.5/weather?q=Prague")
      fun getWeatherData(@Query("appid") appId: String)
              : Call&lt;WeatherData&gt;
  
  }
  </code></pre>
  
  <p>My TemperatureData class</p>
  
  <pre><code>data class TemperatureData(var temp: String)
  </code></pre>
  
  <p>And my WeatherDataJson class</p>
  
  <pre><code>data class WeatherDataJson(var description:String)
  </code></pre>
  
  <p>In my mainclass i have a function to show the json into my screen but i can't load the "var weather..."
  Here is the function </p>
  
  <pre><code>private fun getTemperatureData(repository: Repository) {
          repository.getApiInterface()
                  .getWeatherData("4cf7f6610d941a1ca7583f50e7e41ba3")
                  .enqueue(object : Callback&lt;WeatherData&gt; {
                      override fun onFailure(call: Call&lt;WeatherData&gt;?, t: Throwable?) {
                          t?.printStackTrace()
                      }
  
                      override fun onResponse(call: Call&lt;WeatherData&gt;?, response: Response&lt;WeatherData&gt;?) {
                          val weatherData: WeatherData? = response?.body()
                          weatherData?.let {
                              it.main?.let {
                                  tempText.text = it.temp
                              }
                              it.weather?.let{
                                  weatherTextFromApi.text=it.description
                              }
                          }
                      }
                  })
      }
  </code></pre>
  
  <p>On the <strong>description</strong> is says unresolved reference description</p>