title: Parsing json in Kotlin
body: <p>I'm trying to parse Json in Kotlin. I'm having a lot of trouble, it seems that a lot of people learn Kotlin after Java... Not me, I'm a Python guy. I got a Kotlin Jupyter Notebook running fairly quickly (<a href="https://github.com/ligee/kotlin-jupyter" rel="noreferrer">https://github.com/ligee/kotlin-jupyter</a>), after that I managed to pull information from the bittrex api like so:</p>
  
  <pre><code>import java.net.URL
  val result = URL("https://bittrex.com/api/v1.1/public/getmarkets").readText()
  </code></pre>
  
  <p>It took me a long time to find that I needed to add import java.net.URL, this always seems to be implicit in all code examples. Anyway, this give me a response in json (the "result parameter"):</p>
  
  <pre><code>{"success":true,"message":"","result":[{"MarketCurrency":"LTC","BaseCurrency":"BTC","MarketCurrencyLong":"Litecoin","BaseCurrencyLong":"Bitcoin","MinTradeSize":0.01469482,"MarketName":"BTC-LTC","IsActive":true,"Created":"2014-02-13T00:00:00","Notice":null,"IsSponsored":null,"LogoUrl":"https://bittrexblobstorage.blob.core.windows.net/public/6defbc41-582d-47a6-bb2e-d0fa88663524.png"},{"MarketCurrency":"DOGE","BaseCurrency":"BTC","MarketCurrencyLong":"Dogecoin","BaseCurrencyLong":"Bitcoin","MinTradeSize":274.72527473,"MarketName":"BTC-DOGE","IsActive":true,"Created":"2014-02-13T00:00:00","Notice":null,"IsSponsored":null,"LogoUrl":"https://bittrexblobstorage.blob.core.windows.net/public/a2b8eaee-2905-4478-a7a0-246f212c64c6.png"},{"MarketCurrency ...
  </code></pre>
  
  <p>Now, in Python I'd just add .json() to the "result" parameter and I can then address the json fields as a dictionary with multiple levels, like</p>
  
  <pre><code>result["success"]
  </code></pre>
  
  <p>Would give me:</p>
  
  <pre><code>true
  </code></pre>
  
  <p>Is there something like that for Kotlin? I have tried Klaxon <a href="https://github.com/cbeust/klaxon" rel="noreferrer">https://github.com/cbeust/klaxon</a>, again it took me a lot of time to realize that I have to do <code>import com.beust.klaxon.string</code>, it is not mentioned on the website for example, so a side question is: How do you know what you need to import when you find code examples? It seems like everybody just knows... But I digress.</p>
  
  <p>My main question is: How can I address the separate fields of the Json and get them into separate variables?</p>
  
  <p>Highest regards.</p>