Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6674

The JsonSlurper returns the wrong value type for floating point numbers.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.0-beta-1
    • 2.3.0-rc-1
    • JSON
    • None

    Description

      In the 2.3.0-beta-1 version was broken backward compatibility.

      def result = new JsonSlurper().parseText('{"message":1.5}')
      assert result.message.class == BigDecimal // failed with 2.3.0-beta-1 and was OK before
             |      |       |     |
             |      1.5     |     false
             [message:1.5]  class java.lang.Double
      

      Attachments

        Activity

          People

            guillaume Guillaume Sauthier
            bura Andrey Bloschetsov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: