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

Make JsonBuilder configurable to not write entries with null values

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Trivial
    • Resolution: Duplicate
    • 2.4.5
    • None
    • JSON
    • None

    Description

      JsonBuilder (and underlying JsonOutput ) is writing entries with null values when serializing to Json String:

       {"key1": "value",
        "key2": null}
      

      There should be a flag or configuration value to change this behaviour and skip writing entries where the values are null.

       {"key1": "value"}
      

      Attachments

        Issue Links

          Activity

            People

              jwagenleitner John Wagenleitner
              marcus.lagemann@smaato.com Marcus Lagemann
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: