add returnText option to writeJSON

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • 2.7.0

      Currently theĀ writeJSON step is only able to output the json to a file. However, sometimes we need the resulting json as a string in Groovy. The only workaround is either to write to some temp file and then call readJSON, or to directly call into JSONObject, neither of which is ideal.

      I propose adding a booleanĀ returnText parameter to writeJSON. If it is omitted or false, thenĀ writeJSON preserves its existing behavior. If it is true, then file must not be specified and writeJSON will return the json as a string.

      Example usage:

      String json = writeJSON json: object, returnText: true

      Ā 

            Assignee:
            rsandell
            Reporter:
            Jesse Rittner
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: