title: Jenkinsfile - JsonSlurper returning a string instead of a map
body: <p>So I'm trying out a CI build that has a config.json file embedded.</p>
  
  <pre><code>config.json
  {
    "some_collection": [
      { "foo": "bar" }
    ]
  }
  </code></pre>
  
  <p>My Jenkinsfile:</p>
  
  <pre><code>import groovy.json.JsonSlurper
  
  node {
    bootstrap()
    test()
  }
  def bootstrap() {
    stage('bootstrap') {
      git([url: "git@github.com:my-user/my-jenkinsfile-repo.git"])
    }
  }
  
  def test() {
    def config = getConfig()
    echo "${config}"
    echo "${config.class}"
  }
  
  @NonCPS
  def getConfig() {
    new JsonSlurper().parseText(readFile("./config.json")))
  }
  </code></pre>
  
  <p>The echo of the config object shows the json as it is in the file, and the config.class says is a plain old string. I'm expecting the code about to return a Map.</p>
  
  <p>I've tried JsonSlurper and JsonSluperClassic, I've also tried about every way I can think of to restructure the code to be more explicit and I'm running out of ideas.</p>
  
  <p>EDIT: I've tried adding some strong typing:</p>
  
  <pre><code>def getConfig() {
    JsonSlurper parser = new groovy.json.JsonSlurper()
    def json = readFile("./config.json")
    Map parsedJson = parser.parseText(json)
    return parsedJson
  }
  </code></pre>
  
  <p>This still causes config.class to return as a String</p>