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

Make JsonBuilder configurable to not write entries with null values

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Duplicate
    • Affects Version/s: 2.4.5
    • Fix Version/s: None
    • Component/s: JSON
    • Labels:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: