title: Jayway JsonPath read String Java
body: <p>I receive an array of JSON objects, a part of which is below:</p>
  <pre><code>[{&quot;Team&quot;:&quot;LTD&quot;,&quot;Amount&quot;:10000.0,&quot;Success&quot;:true},
   {&quot;Team&quot;:&quot;XYZ&quot;,&quot;Amount&quot;:50000.0,&quot;Success&quot;:false}]
  </code></pre>
  <p>I want to forcefully read all fields as string so as to make further processing easy and uniform. So <code>Amount</code> must be read as <code>10000.0</code> and not as <code>1.0E5</code>.</p>
  <p>Below is the code snippet that I use :</p>
  <pre><code>String input=IOUtils.toString(inputStream);
  String[] fields=&quot;Amount|Success&quot;.split(&quot;\\|&quot;);
  ReadContext inputParsed =JsonPath.parse(input);
  List&lt;JSONArray&gt; resultList=Arrays.stream(fields)
                            .map(x -&gt; inputParsed.read(&quot;$[*].&quot;+x,JSONArray.class))
                            .collect(Collectors.toList());
  //Further code to process resultList
  </code></pre>
  <p>When I print the values and type of <code>Amount</code> from <code>resultList</code>, they are shown as <code>1.0E5</code> and <code>String</code> respectively. In between parsing and reading, the conversion from <code>Double</code> to <code>String</code> seems to occur in unexpected way.</p>
  <p>I read a similar post <a href="https://stackoverflow.com/questions/51300567/jayway-jsonpath-read-long-java">here</a> and it addresses a bit different problem.</p>
  <p>The <code>inputStream</code> and <code>fields</code>, which are to be extracted , will be provided at run time. Hence, using POJO and other methods that need to define Class won't work.</p>