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

JsonSlurper parses badly format JSON without throwing exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.14
    • 5.0.0-alpha-4, 4.0.17
    • JSON
    • None

    Description

      JsonSlurper should throw a JsonException when parsing the following input:

      """
      {
         "a":1,
         "b": {
              "c":2
          }"""
      

       
      But it parses the string successfully.  On the other hand, it does throw a JsonException when parsing
       

      """
      {
         "a":1,
         "b": {
              "c":2
          }
      """
      

      where the ending """ is on a separate line.
       
      I think it should fail for both.

      Attachments

        Activity

          People

            paulk Paul King
            bocamel John Yin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: