Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-50660

Whitelist: JsonOutput.toJson(Object) not included in generic whitelist

XMLWordPrintable

      Currently, you cannot output arrays or lists as JSON in pipeline scripts by default. This is because - unlike almost all other overloads of JsonOutput.toJson - JsonOutput.toJson(Object) is not on the generic whitelist.

      If this method is somehow problematic from a security POV, feel free to explain and close this issue, but I cannot see any reason to disallow this overload. According to the JavaDoc, this is what it does:

      Returns:
      "null" for a null value, or a JSON array representation for a collection, array, iterator or enumeration, or representation for other object.

            Unassigned Unassigned
            mb_o Moritz Baumann
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: