Class ConfigurableJsonSlurper

java.lang.Object
io.restassured.internal.path.json.ConfigurableJsonSlurper

public class ConfigurableJsonSlurper extends Object
Copy of Groovy's JsonSlurper class. The reason why this is needed is because in 1.8.5+ Groovy's JsonSlurper no longer returns floats and doubles and instead returns BigDecimal. ExpandoMetaClasses doesn't work for Java classes so that's the technical reason for copying (what we really want to do is to override the JsonToken.getValue()). In order to maintain RA backward compatibility this class is created. The copied methods are:
  1. parse
  2. parseText
  3. parseArray
  4. parseObject

There's also a tiny change in the parse method indicated by the "Added by Johan Haleby" comment.

  • Constructor Details

  • Method Details

    • parseText

      public Object parseText(String text)
      Parse a text representation of a JSON data structure
      Parameters:
      text - JSON text to parse
      Returns:
      a data structure of lists and maps
    • parse

      public Object parse(Reader reader)
      Parse a JSON data structure from content from a reader
      Parameters:
      reader - reader over a JSON content
      Returns:
      a data structure of lists and maps