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

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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0-beta-1
    • Fix Version/s: 2.3.0-rc-1
    • Component/s: JSON
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: