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

StreamingJsonBuilder adding extra comma

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.5.7, 2.5.8
    • Fix Version/s: None
    • Component/s: JSON
    • Labels:

      Description

      This test passes in Groovy 2.5.6 - but not in 2.5.7/8:

      https://github.com/grails/grails-core/blob/beafdce14d05f15abb18a079f9bb681f8761fe45/grails-plugin-rest/src/test/groovy/org/grails/plugins/web/rest/render/VndErrorRenderingSpec.groovy#L74-L109

      Code where the error happens:

      https://github.com/grails/grails-core/blob/7ab9e47ad805fbeb9433a488dd33f91bef44c0fa/grails-plugin-rest/src/main/groovy/grails/rest/render/errors/VndErrorJsonRenderer.groovy#L56-L75

      The JSON produced includes an extra comma:

       ,"_links":{(,)"resource":{(,)"href":"http://localhost/books/1"}}},{"logref":"book.title.bad.1","message":"Title Bad","path":"http://localhost/books/1","_links":{(,)"resource":{(,)"href":"ht ,"_links":{(-)"resource":{(-)"href":"http://localhost/books/1"}}},{"logref":"book.title.bad.1","message":"Title Bad","path":"http://localhost/books/1","_links":{(-)"resource":{(-)"href":"ht
      

      To change the Groovy version for this project you can set it here - https://github.com/grails/grails-core/blob/master/build.gradle#L31

       

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              erichelgeson Eric Helgeson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: