-
Bug
-
Resolution: Unresolved
-
Minor
-
None
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.
Seems like a reasonable addition to me - not sure if/when I'll get a chance to open a PR with this change, so feel free to do so yourself!