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

JsonOutput does not escape double quotes in map keys

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Duplicate
    • Affects Version/s: 2.4.1
    • Fix Version/s: None
    • Component/s: JSON
    • Labels:

      Description

      Double quotes (") should be escaped in JSON.

      JsonOutput does not perform this escaping for map keys:

      assert groovy.json.JsonOutput.toJson(['the "quoted" key':'bug']) == /{"the \"quoted\" key":"bug"}/
                                    |                                  |
                                    {"the "quoted" key":"bug"}         false
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rene.scheibe Rene Scheibe
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: